Subject Re: [firebird-support] Re: Locking tables
Author Ann W. Harrison
Rick DeBay wrote:
> Ann, is this pseudo code correct for your gateway pattern?
> Begin TX
> Update ROOM_TABLE.RESERVER to unique id of reserver
select a free time
> Insert record into RESERVATION_TABLE
> Update ROOM_TABLE.RESERVER to null
> Commit TX

You don't need to set ROOMS.RESERVER to null. It's not a bad idea, but
unless you've got an uncommitted update on that record, you're not going
to get to the next step. The trigger on RESERVATIONS protects the
application from random, rogue updates through ISQL or other tools, at
least from random rogue updates not initiated by the current user.