Главная страница | назад





Article #19506: Informix Online and ROW LEVEL LOCKING (LOCK MODE ROW)

 Question and Answer Database

     FAQ: FAQ4506B - Informix Online and ROW LEVEL LOCKING (LOCK MODE ROW)
Category: Database (Informix)
Platform: All-32Bit
 Product: All-CBuilder,   BC++5.x,   C++Builder1.0,   C++Builder3.x,   C++Builder4.x,   Delphi2.x,   Delphi3.x,   Delphi4.x,   VdBase7.x,   

Question:

Is it possible to do row level locking when working with an Informix
server?


Answer:

All settings and options for row level locking are done
at the table and database level.  
The client application does not require any modifications 
or specific Informix server support to benefit from 
Informix Online row level locking.

Please see your Informix documentation for specific server and 
table settings.


Example Informix table create (please see your Informix 
documentation for specific information):

CREATE TABLE ROWLOCKTEST
(
FLD1 CHAR(5),
FLD2 FLOAT
)
LOCK MODE ROW


LOCK MODE PAGE is the default if not specified.

ALTER TABLE can be used to change the LOCK MODE for a table.


Example:
1)Start a transaction from the Informix client (TDatabase.starttransaction)
2)Modify a row and post (do not commit yet (TDatabase.commit))
3)From another client or connection attempt a change to the updated,
  uncommitted row.  The second client should time out.
4)All rows not currently involved in a transaction can be modified.

If the Informix table in the above example had been created or altered with
LOCK MODE PAGE then rows adjacent (within the same locked page) to the row 
or rows currently part of a pending transaction will also be locked.


7/13/99 10:20:05 AM
 

Last Modified: 01-SEP-99