Many c-tree applications store documents and other non-trivial data types. c-tree allows nearly any type of data to be stored, including text, XML, JSON, PDFs, word processing documents, and email. Frequently, these types of data require alternate indexing algorithms compared to how standard data types are indexed with basic b-tree algorithms. What is needed is a method to hand off these types of record updates to alternative handling.
In V11 and later, a set of Record Update Notification callback functions allows applications to externally process records as they are added or updated within a c-tree database.
These callback functions are called when records in the file are modified (added, updated, and deleted) and are asynchronously processed and persisted. Contrast this with the c-treeACE notification feature which is a memory-based queue. While standard notification can trigger callback handling, this is done in a synchronous manner which can impact up-front application performance. The record update notification callback also handles change events, however, its intent is to allow user-defined actions to occur when a record in a particular table is modified, in a deferred asynchronous manner. With this deferred handling, update events are deferred for background processing while maintaining application responsiveness.
Implementing Record Update Notifications
Function prototypes to handle record updates are located in the following c-tree source module:
ctree\source\ctrucbdll.c
To create a functional shared library, build the module using the c-treeACE build utility mtmake and choose the c-treeACE CTUSER model option. ctuser.dll (or libctuser.so) is generated and this module is then copied into your server's binary folder location.
The callback feature defines three functions:
The ctRecordUpdateCallbackControl() function, described below, is used to add and delete callback function definitions. A file can have more than one callback function definition. Each callback function definition is identified by its name, which is a case-sensitive ASCII string.
Each callback definition consists of the following attributes:
Restrictions
Management API Function
See also: