Skip to content

Commit

Permalink
[JBPM-10088] Sonnar comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Nov 22, 2023
1 parent 475164c commit 00e98d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,18 @@ 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) {
if (environment.get(EnvironmentName.TRANSACTION_MANAGER) instanceof ContainerManagedTransactionManager) {
TransactionManager tm = TransactionManagerFactory.get().newTransactionManager();

if (tm.begin()) {
return tm;
}
}
}
if (!isTimerCMT) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import javax.ejb.TimerService;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.naming.InitialContext;

import org.drools.core.time.JobHandle;
import org.drools.core.time.impl.TimerJobInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import org.drools.core.time.InternalSchedulerService;
import org.drools.core.time.Job;
Expand All @@ -37,9 +36,6 @@
import org.drools.core.time.TimerService;
import org.drools.core.time.Trigger;
import org.drools.core.time.impl.TimerJobInstance;
import org.drools.persistence.api.TransactionManager;
import org.drools.persistence.api.TransactionManagerFactory;
import org.drools.persistence.jta.JtaTransactionManager;
import org.jbpm.process.core.timer.GlobalSchedulerService;
import org.jbpm.process.core.timer.JobNameHelper;
import org.jbpm.process.core.timer.NamedJobContext;
Expand All @@ -50,7 +46,6 @@
import org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment;
import org.jbpm.runtime.manager.impl.jpa.EntityManagerFactoryManager;
import org.jbpm.runtime.manager.impl.jpa.TimerMappingInfo;
import org.kie.internal.runtime.manager.InternalRuntimeManager;
import org.kie.internal.runtime.manager.RuntimeEnvironment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down

0 comments on commit 00e98d7

Please sign in to comment.