isolation level question ?
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Transactions, Locking & Isolation
Hi, I know the difference between the cursor stabililty and repeatable read, but what I need is to lock only the latest row fetched (as cursor stability) and the lock is released only when the transaction commits or rolls back , not when the cursor is closed (as repeatable read), can informix support it ? I'm using INFORMIX-ESQL Version 7.24.UC5. Thanks! Julie
Hi Julie,
You can use the set isolation level to lock the rows only if you use a
select statement, other wise you have to work with a cursor for update.hope I helped.
steffy lin wrote:
> Hi,
>
> I know the difference between the cursor stabililty and repeatable
> read, but what I need is to lock only the latest row fetched (as
> cursor stability) and the lock is released only when the transaction
> commits or rolls back , not when the cursor is closed (as repeatable
> read), can informix support it ?
>
> I'm using INFORMIX-ESQL Version 7.24.UC5.
>
> Thanks!
>
> Julie
--
_________________________________________________________________________
|
| Miya Nadri,
| ATG department.
| ComSoft Technologies Ltd.
| 39 Ha'galim blvd, Herzelia, Israel.
| Tel: 972-9-9598603
| Fax: 972-9-9598980
| E-Mail: miyan@comsoft.co.il
| WEB: www.comsoft.co.il
|________________________________________________________________________
steffy lin wrote: > > Hi, > > I know the difference between the cursor stabililty and repeatable > read, but what I need is to lock only the latest row fetched (as > cursor stability) and the lock is released only when the transaction > commits or rolls back , not when the cursor is closed (as repeatable > read), can informix support it ? > > I'm using INFORMIX-ESQL Version 7.24.UC5. Declare your SELECT (and any INSERT cursor) with the WITH HOLD clause and COMMIT after updating each row with ISOLATION set to CURSOR STABILITY. The ISOLATION level will keep only the current row locked and the COMMIT will release the lock. If you wait to COMMIT until all rows have been updated you will take a lock on each row touched and release those not updated but hold all those that have been updated until the transaction is COMMITted. The WITH HOLD clause will permit the cursors to survive the COMMIT/ROLLBACK. Art S. Kagel