Rollback w/o clearing cache

I need to attempt a post to the database followed by a test of the data posted before it is committed. If the test fails, the users should be able to modify the data and attempt to post again. The problem I am having is that rolling back the transaction empties out the cached updates. If I don't rollback the transaction, I cannot attempt another post because of key violations.

I have tried Rollback, RollbackToSavePoint and CancelUpdates. How do I rollback a transaction while retaining the cached updates (or is there a better way)?

Many thanks.
- Dan Richardson
 
If TOracleSession.ApplyUpdates fails, the database will be in the same state as before the call to ApplyUpdates. This is implemented by a Savepoint/RollbackToSavepoint. In other words, you don't need to rollback anything.

Note that Rollback and RollbackToSavepoint do not clear the cached updates. Only ApplyUpdates (if successful), CancelUpdates, and CommitUpdates clear the cache.

------------------
Marco Kalter
Allround Automations
 
Back
Top