Subject Re: [firebird-support] waiting for eventholds OIT
Author Martijn Tonies
Nick,

> I have a program which just connects to the database and waits for an
> event to occur, it then handles it and waits again (see code excert
> below).
>
> The problem is that it seems to be holding the OIT, after a busy
> period that didn't cause any events oldest & next transactions differ
> by over 400,000, as soon as I caused an event oldest caught up.
>
> I figure I either need to connect with different params or some
> different transaction parameters but I can't see what to change.
>
>
> EXEC SQL CONNECT :db_filename USER :db_username PASSWORD
:db_password;
>
> /* Go with read committed to see updates */
> EXEC SQL SET TRANSACTION READ COMMITTED;

Why are you starting a transaction here?

> EXEC SQL EVENT INIT ALERT_WAIT ('amsalert');
>
> while (0 == 0) /* until killed */
> {
>
> EXEC SQL EVENT WAIT ALERT_WAIT;
> handle alert
> }
>

Why not start the transaction once the event has arrived at the
client, do your thing and commit the transaction?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com