Subject | Re: [IBO] DML Caching - Syncing multiple applications |
---|---|
Author | Markus Ostenried |
Post date | 2005-08-09T13:33:23Z |
At 07:22 Tuesday, 09.08.2005 +0000, Shaq wrote:
when a new record is inserted into IBO$DMLCACHE table then its
DMLUSER-field will be set to CURRENT_USERNAME. The AfterInsert-trigger of
IBO$DMLCACHE table posts an event that the TIB_Synchcursor listens to. Then
the SynchCursor reads all new records from IBO$DMLCACHE with a statement
like this:
SELECT * FROM IBO$DMLCACHE
WHERE DMLID > :LastDmlId
AND DMLUSER <> CURRENT_USERNAME
This ensures that the SynchCursor only reads DMLCache records from other users.
Like you I'm using only one Firebird user account. So instead of comparing
USERNAMEs I store and compare CURRENT_CONNECTION integer values.
HTH,
Markus
>I am not clear on how to implement my own user management for DMLHi,
>Caching. My application logs into Firebird with the same account for
>each instance. The user has his own unique username/password which I
>handle myself.
>
>I didn't see where the user names are being handled. There are no
>properties for the TIB_SyncCursor component. How does the
>TIB_SyncCursor know who to send the the events to? How would I handle
>DML Caching with my own users instead of the connecting user which is
>the example in the survey application?
when a new record is inserted into IBO$DMLCACHE table then its
DMLUSER-field will be set to CURRENT_USERNAME. The AfterInsert-trigger of
IBO$DMLCACHE table posts an event that the TIB_Synchcursor listens to. Then
the SynchCursor reads all new records from IBO$DMLCACHE with a statement
like this:
SELECT * FROM IBO$DMLCACHE
WHERE DMLID > :LastDmlId
AND DMLUSER <> CURRENT_USERNAME
This ensures that the SynchCursor only reads DMLCache records from other users.
Like you I'm using only one Firebird user account. So instead of comparing
USERNAMEs I store and compare CURRENT_CONNECTION integer values.
HTH,
Markus