Skip to content

Commit

Permalink
[JBPM-10088] Some test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Nov 23, 2023
1 parent 5e2aed8 commit 3bba9a7
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,23 @@ protected boolean hasEnvironmentEntry(Environment environment, String name, Obje
}

protected TransactionManager startTxIfNeeded(Environment environment) {
try {
boolean isTimerCMT = hasEnvironmentEntry(environment, "IS_TIMER_CMT", true);
logger.debug ("Timer CMT value is {}", isTimerCMT);
if (!isTimerCMT) {
TransactionManager tm = TransactionManagerFactory.get().newTransactionManager();
if (tm.begin()) {
return tm;
}
}

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;
}
}

} catch (Exception e) {
logger.debug("Unable to optionally start transaction due to {}", e.getMessage(), e);
}

return null;
}

Expand Down

0 comments on commit 3bba9a7

Please sign in to comment.