JtxResourceManager
interface is fairly simple, two most important methods are beginTransaction()
and rollbackTransaction()
.JtxResourceManager
serves as an adapter between JTX framework and some transactional resource. For e.g. database that would be an implementation that takes database session (or connection) and creates a new transaction on it. Since it is an adapter, beginning and rolling back the transactions can be now done through resource manager, without touching the resource itself.JtxTransactionManager
.JtxTransaction
class. The most important thing to remember about it is that:JtxTransaction
is a 'transactional request'. Its existence doesn't mean that real transaction is started on the resources(s). {: .attn}JtxTransactions
are requested from the JtxTransactionManager
. But only when a resource is requested from the jtx transaction, a real transaction is started on the resource!ACTIVE
or NO_TRANSACTION
. As said, JTX transaction is an actual transaction request, therefore even if a real transaction is not required - e.g. as defined by propagation, there will be a JtxTransaction
object in state NO_TRANSACTION
.JtxTransactionManager
is propagation behavior management. This means that manager will handle transaction propagation as defined by transaction mode attribute.PROPAGATION_REQUIRED
- Support a current transaction, create a newPROPAGATION_SUPPORTS
- Support a current transaction, executePROPAGATION_MANDATORY
- Support a current transaction, throw anPROPAGATION_REQUIRES_NEW
- Create a new transaction, suspend thePROPAGATION_NOT_SUPPORTED
- Execute non-transactionally, suspend thePROPAGATION_NEVER
- Execute non-transactionally, throw an exception