Skip to content

Commit

Permalink
[JBPM-10088] Adding trace to check timer cmt value
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Nov 22, 2023
1 parent 6c364e7 commit 1127709
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ protected boolean hasEnvironmentEntry(Environment environment, String name, Obje

protected TransactionManager startTxIfNeeded(Environment environment) {

try {
if (hasEnvironmentEntry(environment, "IS_TIMER_CMT", true)) {
return null;
}
if (environment.get(EnvironmentName.TRANSACTION_MANAGER) instanceof ContainerManagedTransactionManager) {
TransactionManager tm = TransactionManagerFactory.get().newTransactionManager();
if (tm.begin()) {
return tm;
}
}

try {
boolean isTimerCMT = hasEnvironmentEntry(environment, "IS_TIMER_CMT", true);
logger.debug ("Timer CMT value is {}", isTimerCMT);
if (!isTimerCMT) {
if (environment.get(EnvironmentName.TRANSACTION_MANAGER) instanceof ContainerManagedTransactionManager) {
TransactionManager tm = TransactionManagerFactory.get().newTransactionManager();
if (tm.begin()) {
return tm;
}
}
}
} catch (Exception e) {
logger.debug("Unable to optionally start transaction due to {}", e.getMessage(), e);
}
Expand Down

0 comments on commit 1127709

Please sign in to comment.