2.3. Suspending and Resuming a Transaction
suspendmethod is called to temporarily suspend the current transaction associated with the calling thread. If the thread is not associated with any transaction, a
nullobject reference is returned; otherwise, a valid
Transactionobject is returned. The
Transactionobject can later be passed to the
resumemethod to reinstate the transaction context.
resumemethod associates the specified transaction context with the calling thread. If the transaction specified is valid, the transaction context is associated with the calling thread. Otherwise, the thread is not associated with any transaction.
resumemethod is invoked when the calling thread is already associated with another transaction, the Transaction Manager throws the
Transaction tobj = TransactionManager.suspend(); .. TransactionManager.resume(tobj);