Re: Pessimistic Locking via ODBC
Posted in 1997
Omni Hotel — — source: Informix-list mailing list archive (1991-1998)
I use a stored procedure that I call from ODBC execDirect which returns to
me the available number from table the procedure is something like this
procedure next_serial()
returning int
set lock mode to wait 15
begin workselect max(next_num) into next_num from tab1
let new_num = next_num + 1
update tab1 set next_num = new_numcommit work
return new_num
end procedure
Art Zemon > wrote in article
> I have a table which contains one record: a serial number. Many
> concurrently executing instances of my application need to read the
record,
> bump the value of the serial number (keep and use the new value), and
store
> the updated value back into the database... all within the safety of a