- Common ways to obtain TransactionException
private void myMethod () {TransactionException t =
Object[] arguments;new TransactionException(ExceptionMessageGenerator.buildMessage(TransactionException.class, errorNumber, arguments))
TransactionException.externalTransactionNotActive()
UnitOfWorkImpl unitOfWork;TransactionException.inactiveUnitOfWork(unitOfWork)
- Smart code suggestions by Codota
}
/** * Start the current transaction. This can only be invoked if * {@link #isActive()} returns <code>false</code>. * * @throws IllegalStateException * if isActive() is true. */ public void begin() { if (isActive()) { throw new IllegalStateException(TransactionException.transactionIsActive().getMessage()); } //bug307445 : Throw IllegalStateException if entityManager was closed this.wrapper.getEntityManager().verifyOpen(); // always extended this.wrapper.localUOW = this.wrapper.getEntityManager().getActivePersistenceContext(null); this.wrapper.localUOW.setShouldTerminateTransaction(false); this.active = true; }