Subject Global DML Caching with CURRENT_CONNECTION?
Author Thomas Steinmaurer
Hello Jason,

currently, the Global DML Caching mechanism is designed to work distinct
connected users only.

Ever thought about giving it a try with the CURRENT_CONNECTION context
variable instead of USER?

This would mean:

- Works with Firebird only, because InterBase AFAIK does not support
this context variable
- Making the CURRENT_CONNECTION value persistent in the "log table"
- In IB_SyncCursor, change

procedure TIB_SyncCursor.SysPrepareSQL;
begin
inherited SysPrepareSQL;
SQL.Clear;
SQL.Add( 'SELECT ' + FColIDName +
', ' + FColActionName +
', ' + FColKeyFieldsName +
', ' + FColKeyValuesNames );
SQL.Add( 'FROM ' + FTableName );
SQL.Add( 'ORDER BY ' + FColIDName + ' ASCENDING' );
SQLWhereItems.Add( FColIDName + ' > ?LASTID' );
if FColUserName <> '' then
SQLWhereItems.Add( FColUserName + ' <> USER' );
end;


to

procedure TIB_SyncCursor.SysPrepareSQL;
begin
inherited SysPrepareSQL;
SQL.Clear;
SQL.Add( 'SELECT ' + FColIDName +
', ' + FColActionName +
', ' + FColKeyFieldsName +
', ' + FColKeyValuesNames );
SQL.Add( 'FROM ' + FTableName );
SQL.Add( 'ORDER BY ' + FColIDName + ' ASCENDING' );
SQLWhereItems.Add( FColIDName + ' > ?LASTID' );
if FColUserName <> '' then
SQLWhereItems.Add( FColUserName + ' <> CURRENT_CONNECTION' );
end;


Firebird 2.0 even goes one step further, because one could use the
client IP address for checking if it is a "different" client machine,
if, locally running applications should not be affected by a refresh.

Thoughts?


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com