We would like to be able to observe all statements on transaction commit. This is so that migrations may take these statements on commit and add them to any current transferMods queue.
Currently, for prepared transactions, we discard statements on prepare, and don't persist these statements until commit time.
We will have to make changes to the transaction participant in order to persist these statements.
- A new method retrieveOperations() will simply retrieve and return a reference to _transactionOperations. This method will require that the session is checked out, and that it is only called after the transaction has been prepared.
- A new method endTransactionAndClearOperationsInMemory() will clear the _transactionOperations variable and set _transactionOperationBytes to zero.
- The current usage of the method endTransactionAndRetrieveOperations() will be replaced with retrieveOperations() when we want the operations, combined with endTransactionAndClearOperationsInMemory() when we want to clear the transaction memory on commit.
- Prepared transactions will no longer call endTransactionAndRetrieveOperations() on prepare. They will call both retrieveOperations() and endTransactionAndClearOperationsInMemory() on commit.
- Non-prepared transactions will continue to persist the previous behavior of the previous method, calling both retrieveOperationsFor() and endTransactionAndClearOperationsInMemory() on commit.
NOTE: We have renamed retrieveOperationsForMigrate() to retrieveOperations(), because we have identified usage of said operations outside of migrate, including here.