diff --git a/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/timer/GlobalJpaTimerJobInstance.java b/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/timer/GlobalJpaTimerJobInstance.java index 01d2ba8268..4192523c80 100644 --- a/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/timer/GlobalJpaTimerJobInstance.java +++ b/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/timer/GlobalJpaTimerJobInstance.java @@ -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; } diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EJBTimerScheduler.java b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EJBTimerScheduler.java index 88ad489d4b..48f09f2c6f 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EJBTimerScheduler.java +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EJBTimerScheduler.java @@ -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; diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java index 881d6e4305..729e18c070 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java @@ -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; @@ -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; @@ -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;