Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-4197 Always print rollback+timeout warning #4323

Merged
merged 1 commit into from
Nov 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ private EJBException destroyBeanAndRollback(EJBContextImpl context, String type)
try {
container.forceDestroyBean(context);
} finally {
transactionManager.rollback();
rollback();
}

EJBException ex = null;
Expand Down Expand Up @@ -604,7 +604,7 @@ private Throwable checkExceptionBeanMgTx(EJBContextImpl context,
if ( container.isStatefulSession ) {
if ( !container.isSystemUncheckedException(exception) ) {
if( isAppExceptionRequiringRollback(exception) ) {
transactionManager.rollback();
rollback();
} else {
transactionManager.suspend();
}
Expand Down Expand Up @@ -701,19 +701,13 @@ private Throwable completeNewTx(EJBContextImpl context, Throwable exception,
}
else {
try {
if ( status == Status.STATUS_MARKED_ROLLBACK ) {
if (status == Status.STATUS_MARKED_ROLLBACK) {
// EJB2.0 section 18.3.1, Table 15, and 18.3.6:
// rollback tx, no exception
if (transactionManager.isTimedOut()) {
_logger.log(Level.WARNING, "ejb.tx_timeout", new Object[] {
transactionManager.getTransaction(), ejbDescriptor.getName()});
}
transactionManager.rollback();
}
else {
if( (newException != null) &&
isAppExceptionRequiringRollback(newException) ) {
transactionManager.rollback();
rollback();
} else {
if (newException != null && isAppExceptionRequiringRollback(newException)) {
rollback();
} else {
// Note: if exception is an application exception
// we do a commit as in EJB2.0 Section 18.3.1,
Expand All @@ -729,13 +723,20 @@ private Throwable completeNewTx(EJBContextImpl context, Throwable exception,
_logger.log(Level.FINE, "ejb.cmt_exception", ex);
// Commit or rollback failed.
// EJB2.0 section 18.3.6
newException = new EJBException("Unable to complete" +
" container-managed transaction.", ex);
newException = new EJBException("Unable to complete" + " container-managed transaction.", ex);
}
}
return newException;
}

private void rollback() throws SystemException {
if (transactionManager.isTimedOut()) {
_logger.log(Level.WARNING, "ejb.tx_timeout",
new Object[] {transactionManager.getTransaction(), ejbDescriptor.getName()});
}
transactionManager.rollback();
}

private Throwable processSystemException(Throwable sysEx) {
Throwable newException;
if ( sysEx instanceof EJBException)
Expand Down