Last modified: January 09, 2012
Applies to: Windows | Windows Server
The JetRegisterCallback function allows the application to configure the database engine to issue notifications to the application for specific events. These notifications are associated with a specific table and remain in effect only until the instance containing the table is shut down using JetTerm.
Windows XP: JetRegisterCallback is introduced in Windows XP.
JET_ERR JET_API JetRegisterCallback( __in JET_SESID sesid, __in JET_TABLEID tableid, __in JET_CBTYP cbtyp, __in JET_CALLBACK pCallback, __in void* pvContext, __out JET_HANDLE* phCallbackId );
The session to use for this call.
The cursor to use for this call.
A bit mask composed of the callback reasons for which the application wishes to receive notifications.
To create this bit mask, simply or together valid callback reasons from the JET_CBTYP enumeration.
The function pointer to the callback function for the application.
Specifies a context pointer that will be given to the callback function for the application.
Returns a handle that can later be used to cancel the registration of the given callback function using JetUnregisterCallback.
This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.
The operation completed successfully.
It is not possible to complete the operation because all activity on the instance associated with the session has ceased as a result of a call to JetStopService.
It is not possible to complete the operation because the instance associated with the session has encountered a fatal error that requires that access to all data be revoked to protect the integrity of that data. This error will only be returned by Windows XP and later releases.
One of the parameters provided contained an unexpected value or contained a value that did not make sense when combined with the value of another parameter. This error will be returned by JetRegisterCallback when:
It is not possible to complete the operation because the instance associated with the session has not been initialized yet.
It is not possible to complete the operation because a restore operation is in progress on the instance associated with the session.
The same session cannot be used for more than one thread at the same time. This error will only be returned by Windows XP and later releases.
It is not possible to complete the operation because the instance associated with the session is being shut down.
On success, the specified callback will be registered for the given callback reasons with the table associated with the given cursor. No change to the database state will occur.
On failure, the callback will not be registered. No change to the database state will occur.
This method provides a means for the application to associate volatile callbacks with a table in a database. If the application wishes to associate persisted callbacks with a table in the database then it should pass the callback to JET_TABLECREATE using JetCreateTableColumnIndex.
Requires Windows Vista or Windows XP.
Requires Windows Server 2008 or Windows Server 2003.
Declared in Esent.h.