public class TestTransaction extends Object implements AutoCloseable, UserTransaction
| Constructor and Description |
|---|
TestTransaction(PersistenceFactory persistenceFactory,
javax.ejb.TransactionAttributeType transactionAttribute)
Deprecated.
|
TestTransaction(javax.ejb.TransactionAttributeType transactionAttributeType)
Start a Transaction according to
TransactionAttributeType as AutoCloseable to make sure at the
end of the block the transaction is handled accordingly |
| Modifier and Type | Method and Description |
|---|---|
void |
begin() |
void |
close()
used according to AutoCloseable to handle the transaction at the end according to
TransactionAttributeType
see also AutoCloseable.close() |
void |
commit() |
int |
getStatus() |
void |
rollback() |
void |
setRollbackOnly() |
void |
setTransactionTimeout(int i) |
public TestTransaction(javax.ejb.TransactionAttributeType transactionAttributeType)
TransactionAttributeType as AutoCloseable to make sure at the
end of the block the transaction is handled accordinglytransactionAttributeType - defines the kind of transaction to be started.@Deprecated public TestTransaction(PersistenceFactory persistenceFactory, javax.ejb.TransactionAttributeType transactionAttribute)
TransactionAttributeType as AutoCloseable to make sure at the
end of the block the transaction is handled accordinglypersistenceFactory - ignored,transactionAttribute - defines the kind of transaction to be started.public void close()
throws Exception
TransactionAttributeType
see also AutoCloseable.close()close in interface AutoCloseableException - see AutoCloseable.close()public int getStatus()
throws SystemException
getStatus in interface UserTransactionSystemExceptionpublic void rollback()
throws SystemException
rollback in interface UserTransactionSystemExceptionpublic void setRollbackOnly()
throws IllegalStateException,
SystemException
setRollbackOnly in interface UserTransactionIllegalStateExceptionSystemExceptionpublic void commit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
commit in interface UserTransactionRollbackExceptionHeuristicMixedExceptionHeuristicRollbackExceptionSecurityExceptionIllegalStateExceptionSystemExceptionpublic void begin()
begin in interface UserTransactionpublic void setTransactionTimeout(int i)
throws SystemException
setTransactionTimeout in interface UserTransactionSystemExceptionCopyright © 2017–2018. All rights reserved.