Re: How to check if a table is locked
Posted in 1996
Since the question is asking about SE, lock mode is not available in SysTables. Indeed, there is only one lock mode, THE lock mode. In SE, you can check whether a table is locked in exclusive mode by trying to read a row. You can test whether someone else has it locked in share mode by trying to lock it in share mode; if you can do it, then no-one else has the table locked in share mode. You can test whether a database is locked in exclusive mode by trying to open it. Note that OnLine has different locking rules for share mode from those of SE. Specifically, two people can both lock the table in share mode and both are prevented from updating any rows! Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }Date: Mon, 20 May 1996 16:10:44 -0500 (CDT) }From: Cheryl Kendricks <cherylk@prod1.jcdc.doleta.gov> }X-Informix-List-Id: <list.9922> } }Lock mode is in the systables "locklevel" is the column name } }On Sat, 18 May 1996, Billy Wheeler (billy.wheeler@pixie.co.za) wrote: }} At 08:07 AM 5/18/96 GMT, Abdu (abdu@agora.rdrop.com) wrote: }} >: I am working with SQL in a informix SE engine. I don't know how to check }} >: if a table is locked and the lock mode of the database. }} }} LOCK MODE is something you can find in the system catalogs. (I think - no }} manuals to hand :) }} }} If you want to see if something is locked, try lock a record. If you get }} error -246, the record is locked. You could try lock the entire for the same }} results...