public class RepositoryTransactionDemarcation extends SingleExceptionTransactionDemarcation<RepositoryException>
try (RepositoryTransactionDemarcation td = new RepositoryTransactionDemarcation(mTransactionManager)) { ... code to execute within the transaction ... td.setSuccess(true); }
Created: December 06 2013
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
MANDATORY, NEVER, NOT_SUPPORTED, REQUIRED, REQUIRES_NEW, STATUS_CREATED_TRANSACTION_COMMITTED, STATUS_SUSPENDED_TRANSACTION_RESUMED, STATUS_TRANSACTION_CREATED, STATUS_TRANSACTION_ENDED_IN_CODE, SUPPORTS
Constructor and Description |
---|
RepositoryTransactionDemarcation(javax.transaction.TransactionManager pManager)
Create a new RepositoryTransactionDemarcation that begins the
transaction with our default attribute (REQUIRED, unless
overridden).
|
RepositoryTransactionDemarcation(javax.transaction.TransactionManager pManager,
int pTransactionAttribute)
Create a new RepositoryTransactionDemarcation that begins the
transaction with specified transaction attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Throws our exception.
|
protected RepositoryException |
wrapTransactionDemarcationException(TransactionDemarcationException pException)
Wrap TransactionDemarcationException with an exception of type E.
|
isSuccess, setSuccess
begin, begin, end, end, equalTransactions, getDefaultTransactionAttribute, getTransaction, isTransactionCreated, setClearTransactionOnEnd
public RepositoryTransactionDemarcation(javax.transaction.TransactionManager pManager) throws RepositoryException
pManager
- our transaction manager.RepositoryException
public RepositoryTransactionDemarcation(javax.transaction.TransactionManager pManager, int pTransactionAttribute) throws RepositoryException
pManager
- our transaction manager.pTransactionAttribute
- the transaction attribute (such
as REQUIRED, REQUIRES_NEW, etc).RepositoryException
protected RepositoryException wrapTransactionDemarcationException(TransactionDemarcationException pException)
SingleExceptionTransactionDemarcation
wrapTransactionDemarcationException
in class SingleExceptionTransactionDemarcation<RepositoryException>
pException
- the exception to wrap.public void close() throws RepositoryException
close
in interface java.lang.AutoCloseable
close
in class SingleExceptionTransactionDemarcation<RepositoryException>
RepositoryException