Hello,
I'm hoping someone can shed some light on the ability to lock rows in Progress via ODBC.
In short I'd like to be able to do some pessimistic locking. This works using sqlexp on our server with a transaction of the form:
SELECT x,y FROM TABLE z WHERE ... FOR UPDATE;
UPDATE z SET (x,y)=('valuex','valuey') WHERE ... ;
COMMIT;
Unfortunately I cannot get this kind of behavior where the lock is held between my SELECT and my COMMIT when using ODBC. COMMIT doesn't even appear to be supported via ODBC...
Now what confuses me more (or gives me hope) is when I read this in the Merant ODBC Guide:
Repeatable read (2) Locks are obtained for reading and modifying the database. Locks on all modified objects are held until EOT. Locks obtained for reading data are held until EOT. Locks on non-modified access structures (such as indexes and hashing structures) are released after reading.
Serializable (3) All data read or modified is locked until EOT. All access structures that are modified are locked until EOT. Access structures used by the query are locked until EOT.
However nothing I appear to do will hold a lock after a select or after an update. Also, how can I have an EOT without committing or rolling back?
I'm hoping someone can shed some light on the ability to lock rows in Progress via ODBC.
In short I'd like to be able to do some pessimistic locking. This works using sqlexp on our server with a transaction of the form:
SELECT x,y FROM TABLE z WHERE ... FOR UPDATE;
UPDATE z SET (x,y)=('valuex','valuey') WHERE ... ;
COMMIT;
Unfortunately I cannot get this kind of behavior where the lock is held between my SELECT and my COMMIT when using ODBC. COMMIT doesn't even appear to be supported via ODBC...
Now what confuses me more (or gives me hope) is when I read this in the Merant ODBC Guide:
Repeatable read (2) Locks are obtained for reading and modifying the database. Locks on all modified objects are held until EOT. Locks obtained for reading data are held until EOT. Locks on non-modified access structures (such as indexes and hashing structures) are released after reading.
Serializable (3) All data read or modified is locked until EOT. All access structures that are modified are locked until EOT. Access structures used by the query are locked until EOT.
However nothing I appear to do will hold a lock after a select or after an update. Also, how can I have an EOT without committing or rolling back?