Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
SQL syntax for record locks ?????
Date: Tue Dec 28 2004 - 04:56:09 CST
My application connects to a maxdb 7.5 database via odbc-driver
isolation level = commited
I have a special table autonum where i handle automatic counters (order
When inserting a new order record into the orders table the application
Select lastnumber from autonum where searchid = 'order_number'
my_new_ordernumber = lastnumber + 1
update autonum set lastnumber=?my_new_ordernumber where searchid =
Insert into orders (orderno,.......) values(?my_new_orderno,......)
I don't know how to lock the selected record of the autonum tabled
selecting and updating
The select statement above from user1 should lock the record, so that
doing the same select have to wait (will get no new order number) until
of user1 is finished ???!!!
"Select lastnumber from autonum where searchid = 'order_number' WITH
LOCK EXCLUSIVE" with no success ??
When testing user1 select (and wait, no update)
User2 gets the same order_number as user1.
What is the correct syntax of the select commad, that will do the wanted
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb