Permalink
Browse files

adjustments for JPA 2.1/hibernate 5

  • Loading branch information...
1 parent b576a3e commit b61bafedb73fdf59047c07f6c51f5b8aa7ff2d01 @mswiderski mswiderski committed with psiroky Dec 9, 2016
@@ -26,12 +26,6 @@
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.dialect" value="${maven.hibernate.dialect}" />
- <property name="hibernate.connection.driver_class" value="${maven.jdbc.driver.class}" />
- <property name="hibernate.connection.url" value="${maven.jdbc.url}" />
- <property name="hibernate.connection.username" value="${maven.jdbc.username}" />
- <property name="hibernate.connection.password" value="${maven.jdbc.password}" />
- <property name="hibernate.default_schema" value="${maven.jdbc.schema}"/>
-
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
@@ -40,6 +34,7 @@
<persistence-unit name="org.jbpm.logging.jta" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+ <jta-data-source>jdbc/testDS1</jta-data-source>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
@@ -51,12 +46,6 @@
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.dialect" value="${maven.hibernate.dialect}" />
- <property name="hibernate.connection.driver_class" value="${maven.jdbc.driver.class}" />
- <property name="hibernate.connection.url" value="${maven.jdbc.url}" />
- <property name="hibernate.connection.username" value="${maven.jdbc.username}" />
- <property name="hibernate.connection.password" value="${maven.jdbc.password}" />
- <property name="hibernate.default_schema" value="${maven.jdbc.schema}"/>
-
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
@@ -421,10 +421,12 @@ public void beforeProcessStarted(ProcessStartedEvent event) {
ProcessInstance pi1 = ksession.startProcess("IntermediateCatchEvent");
// both processes started
assertEquals(ProcessInstance.STATE_ACTIVE, pi1.getState());
+ manager.disposeRuntimeEngine(runtime);
// wait a bit for some timers to fire
countDownListener.waitTillCompleted();
-
+ runtime = manager.getRuntimeEngine(CaseContext.get("Case-1"));
+ ksession = runtime.getKieSession();
ksession.abortProcessInstance(pi1.getId());
manager.disposeRuntimeEngine(runtime);
@@ -1,2 +1,2 @@
-bitronix.tm.journal.disk.logPart1Filename=${project.build.directory}/btm1.tlog
-bitronix.tm.journal.disk.logPart2Filename=${project.build.directory}/btm2.tlog
+bitronix.tm.journal=null
+bitronix.tm.allowMultipleLrc=true
@@ -1 +1,2 @@
-bitronix.tm.journal=null
+bitronix.tm.journal=null
+bitronix.tm.allowMultipleLrc=true
@@ -79,6 +79,7 @@
<persistence-unit name="org.jbpm.persistence.patient.example" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+ <jta-data-source>jdbc/jbpm-ds</jta-data-source>
<class>org.jbpm.test.entity.Patient</class>
<class>org.jbpm.test.entity.MedicalRecord</class>
<class>org.jbpm.test.entity.RecordRow</class>
@@ -93,11 +94,6 @@
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
- <property name="hibernate.connection.driver_class" value="org.h2.Driver" />
- <property name="hibernate.connection.url" value="jdbc:h2:mem:mydb" />
- <property name="hibernate.connection.username" value="sa" />
- <property name="hibernate.connection.password" value="sasa" />
-
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
</properties>
</persistence-unit>
@@ -46,7 +46,9 @@
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;
+import org.kie.api.task.TaskService;
import org.kie.internal.io.ResourceFactory;
+import org.kie.internal.runtime.manager.TaskServiceFactory;
import org.kie.internal.runtime.manager.context.EmptyContext;
import bitronix.tm.resource.jdbc.PoolingDataSource;
@@ -239,6 +241,19 @@ private void startJPAWIHProcess(String action, Product prod) throws Exception {
RuntimeEnvironment env =
RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder()
.entityManagerFactory(emf)
+ .addEnvironmentEntry("org.kie.internal.runtime.manager.TaskServiceFactory", new TaskServiceFactory(){
+
+ @Override
+ public TaskService newTaskService() {
+ return null;
+ }
+
+ @Override
+ public void close() {
+
+ }
+
+ })
.addAsset(ResourceFactory.newClassPathResource("JPAWIH.bpmn2"),ResourceType.BPMN2)
.get();
RuntimeManager manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(env);

0 comments on commit b61bafe

Please sign in to comment.