 |
» |
|
|
 |
 |
 |

5.47 What is keep cursor?
Key points
- As was described previously, isolation levels can be used to release S locks
prior to the end of the transaction. But by default, X locks are retained
until the end of the transaction. If you want to release X
locks before the transaction terminates use the
KEEP CURSOR clause.
- The
OPEN statement is used to open appropriate scans to access rows in the
active set, and to position the cursor before the first row that should be
fetched. The OPEN statement has an optional KEEP CURSOR clause that affects
the cursor's behavior when a COMMIT WORK or a ROLLBACK WORK statement is
issued.
- If you open a cursor without using the
KEEP CURSOR clause, and you issue a
COMMIT WORK or a ROLLBACK WORK statement without explicitly closing the cursor
(you have not issued a CLOSE statement), ALLBASE/SQL will
automatically close the cursor when the transaction ends. ALLBASE/SQL will
also automatically close the cursor when a ROLLBACK WORK TO SAVEPOINT
statement is issued.
- Issuing explicit
CLOSE statements is good programming practice, even though
ALLBASE/SQL does not explicitly require them under these circumstances.

Page last updated on November 29, 1995
|
|
|