Using isc commit retaining()
To write transaction changes to the database without establishing a new transaction context—the names, system resources, and current state of cursors used in a transaction—use isc_commit_retaining() instead of isc_commit_transaction(). However, isc_commit_retaining() inhibits garbage collection, which is a necessary database activity. The function prototype for isc_commit_retaining() is:
- ISC_STATUS isc_commit_retaining(ISC_STATUS *status_vector,
- isc_tr_handle *trans_handle);
isc_commit_retaining() writes all pending changes to the database, ends the current transaction without closing its record stream and cursors and without freeing its system resources, then starts a new transaction and assigns the existing record streams and system resources to the new transaction. For example, the following call commits a specified transaction, preserving the current cursor status and system resources:
- isc_commit_retaining(status_vector, &trans);
where status_vector is a pointer to a previously declared error status vector, and trans is a pointer to a previously declared and initialized transaction handle.
A call to isc_rollback_transaction() issued after isc_commit_retaining() only rolls back updates and writes occurring after the call to isc_commit_retaining().