Subject | Re: [firebird-support] waiting for eventholds OIT |
---|---|
Author | Martijn Tonies |
Post date | 2007-11-07T11:46:11Z |
Hi Nick,
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
> I got too enthusistic in my snipping, it should be as below.I guess so, yes. What's the point of keeping the transaction open?
>
> Are you saying that I just need to add a commit just before the EVENT
> WAIT below so that there isn't an open transaction when the program is
> waiting for the event?
> EXEC SQL CONNECT :db_filename USER :db_username PASSWORD:db_password;
>I don't see you using the value in "basecontrolident" below.
> /* Go with read committed to see updates */
> EXEC SQL SET TRANSACTION READ COMMITTED;
>
> EXEC SQL SELECT basecontrolident INTO :basecontrolident FROM
> TBLBASECONTROLLER; /* for filename */
> EXEC SQL EVENT INIT ALERT_WAIT ('amsalert');gds__status);
>
> while (0 == 0) /* until killed */
> {
> rowcount = 0;
> EXEC SQL SELECT COUNT (*) INTO :rowcount FROM TBLALERT;
> if (rowcount == 0)
> {
> LOG("DS", LGREF "23","","waiting for alert");
> EXEC SQL EVENT WAIT ALERT_WAIT;
> if (SQLCODE != 0)
> {
> isc_print_sqlerror((short)SQLCODE,
> goto fatal_error;Martijn Tonies
> }
> LOG("DS", LGREF "24","","received alert");
> }
> handle event
> commit
> end while
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