FairCom Corporation
 
FairCom Start PageFairCom ProductsDownloadsDeveloper SupportSales InformationFairCom CustomersFairCom Company InformationContact FairCom

Homebulletgrey.gifeNewsletterbulletgrey.gifVolume 24bulletgrey.gifServer Queues and Notification


c-tree Server Queues and Notification

c-tree Server System Queues

With c-tree Server-based queues, client programs, connected to the same server, can pass information among each other, emulating a powerful inter-process communications mechanism that is portable, scalable and distributed.

c-tree Server-based queues, also referred to as system queues, extend the concepts of c-tree inter-thread queue routines by providing two additional features:

  • System queues operate across the client/server boundary.
  • System queues can be named so that different clients connected to the same c-tree Server may share the same queue.
  • Server-based queues provide the foundation on which the c-tree Server's file notification feature is built.

File Notification

c-tree Server Notifications

Notification is a novel evolution of our enhanced system queue support. Using the facilities of c-tree system queues, client applications can direct the c-tree Server to monitor a data file and place notification messages on a queue when changes are made to the file.

One exciting application of notification has been a c-tree Server replication model for non-transaction processed files. Passing notification messages as records are added, deleted and updated allow a central master c-tree Server to notify geographically remote servers of changes and update accordingly.

Each notification message includes the following details:

  • The type of operation (add, delete, or update)
  • For a transaction-controlled file, the transaction number in which the change occurred
  • The record offset of the modified record.

The following optional information can also be included in notification messages:

  • The unique key value involved in the operation. (An update may return both old and new key values.)
  • The record image involved in the operation. (An update may return both old and new record images.)

The node name of the client that performed the operation.

Customer Notification Callbacks with the c-tree Server SDK

Instead of passing the notification information to a queue, use the c-tree Server SDK to make calls to ctCallback to associate a callback function to a notification. This callback is a user function assigned to perform a specific custom task to the application when notified. An excellent use of this could be to build an audit trail for a particular action taken with the c-tree Server. Ledger updates and reporting events are other possible candidates.

ctCallback is used in the same manner as ctNotify except that the third parameter is a pointer to a callback function instead of a queue handle:

NINT ctCallback(NINT opcode, NINT objhandle, 
ctCallbackPtr cbptr, NINT contents, NINT controls);

A notification setup with ctCallback causes the function pointed to by cbptr to be called (instead of a message written to a queue). This capability is only available with the Server SDK, and ctCallback can only be called from code compiled into the server itself (using the server SDK).

The prototype for the callback function pointer is:

typedef NINT (*ctCallbackPtr)(pVOID msg, NINT msglen, 
pVOID aux, NINT auxlen);

The callback function returns NO_ERROR on success and a non-zero value on failure. Parameter msg and the optional parameter aux are input parameters. If both msg and aux are passed in, then they should be conceptually pasted together to form one long message.

It is important to note that as currently coded, the target file’s header semaphore is held while the callback function is executed. Therefore the callback function cannot introduce pauses or delays or attempt to lock the header of the target file.

How do I Put c-tree Queues and Notification Into My Application?

Grab all the details in Chapters 9 and 10 of the V8.14 Update Guide found on our support documentation web site.

Follett Software Company utilizes FairCom technology as part of their Catalog Plus and Circulation Plus library automation systems. Catalog Plus offers powerful searching of entire library collections including books, periodicals, audio and video files, eBooks, and a host of other media.

Follett's Circulation Plus system is designed to minimize the work associated with circulation and inventory management by automating these tasks. This includes routine circulation tasks that are typically performed by hand such as checking-in and checking-out books, calculating fines, sending overdue notices, and processing renewals. Circulation Plus puts complete inventory control in the hands of the librarian.

The portability and flexibility that has been part of FairCom's reputation for over 20 years have been fundamentally important to FSC. c-tree Plus' native support for multiple platforms, including Windows, Novell Netware, and Apple Macintosh, means that no changes are required in the database code when moving an application to different operating systems. The c-tree Server's heterogeneous networking allows FSC's engineers to implement Catalog Plus and Circulation Plus on different server platforms while supporting clients using any combination of Windows and Mac operating systems. FairCom handles all data conversions between the various operating systems and allows FSC to concentrate on what its customers need from the application and how to deliver it most efficiently.

The c-tree Server's client/server architecture allows FSC to maximize performance since database operations take place on the Server machine, thus reducing network I/O common with other databases. Clients access the server only when requesting data and only the results travel across the network, not the entire data search detail. In addition, FairCom's full-featured transaction processing assures that vital data will be preserved even in the face of a catastrophic failure, such as a machine crash or power failure.

Read More... (510KB PDF)

FairCom Start PageSite MapContact FairComThe FairCom Privacy Policy Your Location: USA | Europe | Brazil | Japan
Copyright 2012 FairCom Corporation. All rights reserved.