RDbNotifier Class Reference

class RDbNotifier

Provides notification of database changes to clients.

This is useful for shared databases.

Public Member Functions
IMPORT_C voidCancel()
IMPORT_C voidClose()
IMPORT_C voidNotifyChange(TRequestStatus &)
IMPORT_C voidNotifyUnlock(TRequestStatus &)
IMPORT_C TIntOpen(RDbDatabase &)
Public Member Enumerations
enumTEvent { EClose, EUnlock, ECommit, ERollback, ERecover }
Private Attributes
RDbHandle< CDbNotifier >iNotifier

Member Functions Documentation

Cancel()

IMPORT_C voidCancel()

Close()

IMPORT_C voidClose()

NotifyChange(TRequestStatus &)

IMPORT_C voidNotifyChange(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

NotifyUnlock(TRequestStatus &)

IMPORT_C voidNotifyUnlock(TRequestStatus &aStatus)

Makes an asynchronous request for notification of a database event. All events, including the release of all read locks, are reported.

When a database event occurs, the request completes and the TRequestStatus objectcontains one of the enumerators defined by the TEvent enumeration member.

Alternatively, if an outstanding request is cancelled by a call to the Cancel() member function of this class, then the request completes with KErrCancel.

Only one notification request can be outstanding on this notifier at any one time.

Note that if further database events occur while a client is handling a request completion, the notifier records the most significant database event and this is signalled as soon as the client issues the next NotifyUnlock() or NotifyChange() request.

Parameters

TRequestStatus & aStatusThe request status object. If the request is cancelled, this is set to KErrCancel. If the request completes normally, this is set to one of the enumerator values defined by the TEvent enumeration member.

Open(RDbDatabase &)

IMPORT_C TIntOpen(RDbDatabase &aDatabase)

Opens a DBMS change notifier on a database.

Note that a notifier cannot be opened on a client side database.

Parameters

RDbDatabase & aDatabaseThe database to be observed.

Member Enumerations Documentation

Enum TEvent

Defines the events which may be reported by a DBMS change notifier through this RDbNotifier object.

Each enumerator corresponds to a distinct event type.

The changes are reported through a TRequestStatus object when an outstanding notification request completes.

Notes

If further database events occur while a client is handling the completion of a previous event, the notifier remembers the most significant event. The order of importance is:

ERecover > ERollback > ECommit

where the symbol > means "is more important than"

Enumerators

EClose

The database has been closed.

EUnlock

All read locks have been removed.

ECommit

A transaction has been committed.

ERollback

A transaction has been rolled back

ERecover

The database has been recovered

Member Data Documentation

RDbHandle< CDbNotifier > iNotifier

RDbHandle< CDbNotifier >iNotifier[private]