public void requestWriteOperation ( TxOperation op ) { // Check if in a higher transactional mode than none and capture the transaction id if so. TxId txId = null ; if ( getIsolationLevel ( ) . compareTo ( IsolationLevel . None ) > 0 ) { // Extract the current transaction id. txId = TxManager . getTxIdFromThread ( ) ; // Ensure that this resource is enlisted with the current session. enlistWithSession ( ) ; } // For non-transactional isolation levels, apply the requested operation immediately. if ( getIsolationLevel ( ) . equals ( IsolationLevel . None ) ) { op . execute ( ) ; } // Add the operation to the transaction write-behind cache for the transaction id, if using transactional // isolation, to defer the operation untill commit time. else { addCachedOperation ( txId , op ) ; } }
Requests an operation that alters the transactional resource . This may be blocked until an appropriate lock can be acquired delayed until commit time or actioned upon a copy of the data structure private to a transaction branch .