When a transaction ends, an application behaves with certain
characteristics.
- All locks on database server objects are released, except those
that are associated with a held cursor.
- Prepared statements are preserved from one transaction to the
next if the data source supports statement caching (as Db2 for z/OS® does).
After a statement is prepared on a specific statement handle, it does
not need to be prepared again even after a commit or rollback, provided
the statement continues to be associated with the same statement handle.
- Cursor names, bound parameters, and column bindings are maintained
from one transaction to the next.
- By default, cursors are preserved after a commit (but not a rollback).
All cursors are defined using the WITH HOLD clause (except when connected
to Db2 server for VSE and VM,
which does not support the WITH HOLD clause).