RE: table locking
Posted in 1998
Controlling SELECTs is the problem. Without logging, SELECTs work even
though
the table is locked. With logging, a user can 'SET ISOLATION TO DIRTY
READ'
and view/unload data.
Drastic solutions come to mind.
1. Probably the safest is to Revoke privileges on the table for the
period...in
a transaction
BEGIN WORK;
LOCK TABLE....
REVOKE SELECT ON ... FROM ... --do your thing...
GRANT SELECT ON ... TO ...COMMIT WORK;
Note : If your process fails, the REVOKE statement gets rolled back.
Of course, depending on how your table security is implemented, the
REVOKE/GRANTs
could be multiple, and painful.
2. Another possibility is to 'hide' the table by using the RENAME
statement...
again,
in a transaction.
Rudy Fernandes
Purolator Courier
-----Original Message-----
From: "Yan Zhu" [SMTP:yan.zhu@infinity-insurance.com]
Sent: December 7, 1998 3:59 PM
To: "informix-list@iiug.org" [SMTP:informix-list@iiug.org]
Subject: table locking
How do you lock a table in exclusive mode so no other users can update,
view, or unload the
data until you release the lock.