Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

JBPM-3888: Migrating from Hibernate 3 to Hibernate 4

- This is the first commit. Because of build and dependencey issues,
  there will be subsequent commits which can not be made until
  after this commit has been processed by the build system
  (jenkins/maven).
  • Loading branch information...
commit c3e8844a4550a1619c3294fa779e601ce1326a1b 1 parent 3e9f6bb
@mrietveld mrietveld authored
Showing with 454 additions and 1,522 deletions.
  1. +1 −19 jbpm-bam/pom.xml
  2. +0 −43 jbpm-bam/src/main/java/org/jbpm/process/audit/HibernateUtil.java
  3. +0 −112 jbpm-bam/src/main/java/org/jbpm/process/audit/ProcessInstanceDbLog.java
  4. +0 −112 jbpm-bam/src/main/java/org/jbpm/process/audit/WorkingMemoryDbLogger.java
  5. +0 −31 jbpm-bam/src/main/resources/AuditLog.hbm.xml
  6. +17 −14 jbpm-bam/src/test/filtered-resources/META-INF/persistence.xml
  7. +0 −38 jbpm-bam/src/test/filtered-resources/hibernate.cfg.xml
  8. +0 −38 jbpm-bam/src/test/java/org/jbpm/process/audit/ProcessInstanceDbLogTest.java
  9. +28 −12 jbpm-bam/src/test/java/org/jbpm/process/audit/WorkingMemoryDbLoggerTest.java
  10. +0 −18 jbpm-bpmn2/pom.xml
  11. +10 −5 jbpm-bpmn2/src/test/filtered-resources/META-INF/persistence.xml
  12. +1 −0  jbpm-examples/pom.xml
  13. +19 −11 jbpm-examples/src/main/resources/META-INF/persistence.xml
  14. +14 −16 jbpm-gwt/jbpm-gwt-console-server/pom.xml
  15. +0 −49 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/gwt-console-server-as5.xml
  16. +0 −38 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/resources/gwt-console-server-persistence-JPA1.xml
  17. +7 −6 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/resources/gwt-console-server-persistence-JPA2.xml
  18. +11 −10 jbpm-gwt/jbpm-gwt-console-server/src/main/resources/META-INF/persistence.xml
  19. +5 −18 jbpm-gwt/jbpm-gwt-core/pom.xml
  20. +46 −33 jbpm-gwt/jbpm-gwt-core/src/test/filtered-resources/META-INF/persistence.xml
  21. +0 −55 jbpm-gwt/jbpm-gwt-core/src/test/resources/META-INF/JBPMorm.xml
  22. +9 −25 jbpm-human-task/jbpm-human-task-core/pom.xml
  23. +1 −1  ...-task/jbpm-human-task-core/src/main/java/org/jbpm/task/service/persistence/TaskLocalTransactionManager.java
  24. +2 −2 jbpm-human-task/jbpm-human-task-core/src/main/resources/META-INF/TaskEventsorm.xml
  25. +2 −2 jbpm-human-task/jbpm-human-task-core/src/main/resources/META-INF/Taskorm.xml
  26. +13 −7 jbpm-human-task/jbpm-human-task-core/src/test/filtered-resources/META-INF/persistence.xml
  27. +2 −14 jbpm-human-task/jbpm-human-task-war/pom.xml
  28. +0 −47 jbpm-human-task/jbpm-human-task-war/src/main/assembly/human-task-war-as5.xml
  29. +0 −42 jbpm-human-task/jbpm-human-task-war/src/main/assembly/resources/ht-persistence-JPA1.xml
  30. +12 −8 jbpm-human-task/jbpm-human-task-war/src/main/resources/META-INF/persistence.xml
  31. +20 −12 jbpm-human-task/jbpm-human-task-war/src/test/resources/META-INF/persistence.xml
  32. +0 −14 jbpm-installer/build.xml
  33. +0 −36 jbpm-installer/db/ProcessInstanceInfo.hbm.xml
  34. +0 −41 jbpm-installer/db/ProcessInstanceInfoMapping.xml
  35. +0 −39 jbpm-installer/db/jbpm-persistence-JPA1.xml
  36. +0 −47 jbpm-installer/db/task-persistence-JPA1.xml
  37. +19 −11 jbpm-installer/task-service/resources/META-INF/persistence.xml
  38. +6 −5 jbpm-persistence-jpa/pom.xml
  39. +21 −29 jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/processinstance/ProcessInstanceInfo.java
  40. +0 −17 jbpm-persistence-jpa/src/main/resources/META-INF/JBPMorm-JPA2.xml
  41. +6 −4 jbpm-persistence-jpa/src/main/resources/META-INF/JBPMorm.xml
  42. +0 −36 jbpm-persistence-jpa/src/main/resources/META-INF/ProcessInstanceInfo.hbm.xml
  43. +0 −43 jbpm-persistence-jpa/src/main/resources/META-INF/ProcessInstanceInfoMapping-JPA2.xml
  44. +13 −30 jbpm-persistence-jpa/src/test/filtered-resources/META-INF/persistence.xml
  45. +0 −36 jbpm-persistence-jpa/src/test/resources/META-INF/persistence-JPA2.xml
  46. +8 −9 jbpm-persistence-jpa/src/test/resources/log4j.xml
  47. +3 −1 jbpm-services/.gitignore
  48. +4 −6 jbpm-services/droolsjbpm-knowledge-services/pom.xml
  49. +12 −11 jbpm-services/droolsjbpm-knowledge-services/src/test/resources/META-INF/persistence.xml
  50. +6 −4 jbpm-services/executor-services/pom.xml
  51. +2 −2 jbpm-services/executor-services/src/main/resources/META-INF/Executor-orm.xml
  52. +11 −4 jbpm-services/executor-services/src/test/resources/META-INF/persistence.xml
  53. +4 −4 jbpm-services/form-services/pom.xml
  54. +2 −2 jbpm-services/form-services/src/main/resources/META-INF/Settingsorm.xml
  55. +12 −8 jbpm-services/form-services/src/test/resources/persistence.xml
  56. +10 −11 jbpm-services/jbpm-human-task-services/pom.xml
  57. +2 −2 jbpm-services/jbpm-human-task-services/src/main/resources/META-INF/Taskorm.xml
  58. +12 −9 jbpm-services/jbpm-human-task-services/src/test/filtered-resources/META-INF/persistence.xml
  59. +10 −13 jbpm-services/jbpm-human-task-services/src/test/resources/META-INF/persistence.xml
  60. +8 −7 jbpm-services/jbpm-human-task-workitems/pom.xml
  61. +9 −12 jbpm-services/jbpm-human-task-workitems/src/test/resources/META-INF/persistence.xml
  62. +3 −4 jbpm-services/jbpm-shared-services/pom.xml
  63. +10 −45 jbpm-services/pom.xml
  64. +8 −26 jbpm-test/pom.xml
  65. +12 −11 jbpm-test/src/main/resources/META-INF/persistence.xml
  66. +21 −13 jbpm-test/src/test/resources/META-INF/persistence.xml
  67. +0 −92 pom.xml
View
20 jbpm-bam/pom.xml
@@ -63,6 +63,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -108,23 +109,4 @@
</properties>
- <profiles>
- <profile>
- <id>hibernate-4</id>
- <dependencies>
- <!-- compile necessary for hibernate based (logger) classes -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
</project>
View
43 jbpm-bam/src/main/java/org/jbpm/process/audit/HibernateUtil.java
@@ -1,43 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jbpm.process.audit;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-
-class HibernateUtil {
-
- private static final SessionFactory sessionFactory;
-
- static {
- try {
- sessionFactory = new Configuration().configure().buildSessionFactory();
- } catch (Throwable ex) {
- System.err.println("Initial SessionFactory creation failed." + ex);
- throw new ExceptionInInitializerError(ex);
- }
- }
-
- public static SessionFactory getSessionFactory() {
- return sessionFactory;
- }
-
- public static void close() {
- sessionFactory.close();
- }
-
-}
View
112 jbpm-bam/src/main/java/org/jbpm/process/audit/ProcessInstanceDbLog.java
@@ -1,112 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jbpm.process.audit;
-
-import java.util.List;
-
-import org.hibernate.Session;
-
-/**
- * This class has been deprecated in favor of {@link JPAProcessInstanceDbLog}.
- *
- *Please, please use that class instead of this.
- */
-@Deprecated
-public class ProcessInstanceDbLog {
-
- @SuppressWarnings("unchecked")
- public static List<ProcessInstanceLog> findProcessInstances() {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> result = session.createQuery("from ProcessInstanceLog").list();
- session.getTransaction().commit();
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public static List<ProcessInstanceLog> findProcessInstances(String processId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> result = session.createQuery(
- "from ProcessInstanceLog as log where log.processId = ?")
- .setString(0, processId).list();
- session.getTransaction().commit();
- return result;
- }
-
- public static List<ProcessInstanceLog> findActiveProcessInstances(String processId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> result = session.createQuery(
- "from ProcessInstanceLog as log where log.processId = ? AND log.end is null")
- .setString(0, processId).list();
- session.getTransaction().commit();
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public static ProcessInstanceLog findProcessInstance(long processInstanceId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> result = session.createQuery(
- "from ProcessInstanceLog as log where log.processInstanceId = ?")
- .setLong(0, processInstanceId).list();
- session.getTransaction().commit();
- return result == null || result.size() == 0 ? null : result.get(0);
- }
-
- @SuppressWarnings("unchecked")
- public static List<NodeInstanceLog> findNodeInstances(long processInstanceId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<NodeInstanceLog> result = session.createQuery(
- "from NodeInstanceLog as log where log.processInstanceId = ?")
- .setLong(0, processInstanceId).list();
- session.getTransaction().commit();
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public static List<NodeInstanceLog> findNodeInstances(long processInstanceId, String nodeId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<NodeInstanceLog> result = session.createQuery(
- "from NodeInstanceLog as log where log.processInstanceId = ? and log.nodeId = ?")
- .setLong(0, processInstanceId)
- .setString(1, nodeId).list();
- session.getTransaction().commit();
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public static void clear() {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> processInstances =
- session.createQuery("from ProcessInstanceLog").list();
- for (ProcessInstanceLog processInstance: processInstances) {
- session.delete(processInstance);
- }
- List<NodeInstanceLog> nodeInstances =
- session.createQuery("from NodeInstanceLog").list();
- for (NodeInstanceLog nodeInstance: nodeInstances) {
- session.delete(nodeInstance);
- }
- session.getTransaction().commit();
- }
-
-}
View
112 jbpm-bam/src/main/java/org/jbpm/process/audit/WorkingMemoryDbLogger.java
@@ -1,112 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jbpm.process.audit;
-
-import java.util.Date;
-import java.util.List;
-
-import org.drools.WorkingMemory;
-import org.drools.audit.WorkingMemoryLogger;
-import org.drools.audit.event.LogEvent;
-import org.drools.audit.event.RuleFlowLogEvent;
-import org.drools.audit.event.RuleFlowNodeLogEvent;
-import org.kie.event.KnowledgeRuntimeEventManager;
-import org.hibernate.Session;
-
-/**
- * This class has been deprecated in favor of {@link JPAWorkingMemoryDbLogger}.
- *
- * Please, please use that class instead of this.
- */
-@Deprecated
-public class WorkingMemoryDbLogger extends WorkingMemoryLogger {
-
- public WorkingMemoryDbLogger(WorkingMemory workingMemory) {
- super(workingMemory);
- }
-
- public WorkingMemoryDbLogger(KnowledgeRuntimeEventManager session) {
- super(session);
- }
-
- public void logEventCreated(LogEvent logEvent) {
- switch (logEvent.getType()) {
- case LogEvent.BEFORE_RULEFLOW_CREATED:
- RuleFlowLogEvent processEvent = (RuleFlowLogEvent) logEvent;
- addProcessLog(processEvent.getProcessInstanceId(), processEvent.getProcessId());
- break;
- case LogEvent.AFTER_RULEFLOW_COMPLETED:
- processEvent = (RuleFlowLogEvent) logEvent;
- updateProcessLog(processEvent.getProcessInstanceId());
- break;
- case LogEvent.BEFORE_RULEFLOW_NODE_TRIGGERED:
- RuleFlowNodeLogEvent nodeEvent = (RuleFlowNodeLogEvent) logEvent;
- addNodeEnterLog(nodeEvent.getProcessInstanceId(), nodeEvent.getProcessId(), nodeEvent.getNodeInstanceId(), nodeEvent.getNodeId(), nodeEvent.getNodeName());
- break;
- case LogEvent.BEFORE_RULEFLOW_NODE_EXITED:
- nodeEvent = (RuleFlowNodeLogEvent) logEvent;
- addNodeExitLog(nodeEvent.getProcessInstanceId(), nodeEvent.getProcessId(), nodeEvent.getNodeInstanceId(), nodeEvent.getNodeId(), nodeEvent.getNodeName());
- break;
- default:
- // ignore all other events
- }
- }
-
- private void addProcessLog(long processInstanceId, String processId) {
- ProcessInstanceLog log = new ProcessInstanceLog(processInstanceId, processId);
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- session.save(log);
- session.getTransaction().commit();
- }
-
- private void updateProcessLog(long processInstanceId) {
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- List<ProcessInstanceLog> result = session.createQuery(
- "from ProcessInstanceLog as log where log.processInstanceId = ? and log.end is null")
- .setLong(0, processInstanceId).list();
- if (result != null && result.size() != 0) {
- ProcessInstanceLog log = result.get(result.size() - 1);
- log.setEnd(new Date());
- session.update(log);
- }
- session.getTransaction().commit();
- }
-
- private void addNodeEnterLog(long processInstanceId, String processId, String nodeInstanceId, String nodeId, String nodeName) {
- NodeInstanceLog log = new NodeInstanceLog(NodeInstanceLog.TYPE_ENTER, processInstanceId, processId, nodeInstanceId, nodeId, nodeName);
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- session.save(log);
- session.getTransaction().commit();
- }
-
- private void addNodeExitLog(long processInstanceId, String processId, String nodeInstanceId, String nodeId, String nodeName) {
- NodeInstanceLog log = new NodeInstanceLog(NodeInstanceLog.TYPE_EXIT, processInstanceId, processId, nodeInstanceId, nodeId, nodeName);
- Session session = HibernateUtil.getSessionFactory().getCurrentSession();
- session.beginTransaction();
- session.save(log);
- session.getTransaction().commit();
- }
-
- public void dispose() {
- HibernateUtil.getSessionFactory().getCurrentSession().close();
- HibernateUtil.close();
- }
-
-}
View
31 jbpm-bam/src/main/resources/AuditLog.hbm.xml
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping>
-
- <class name="org.jbpm.process.audit.ProcessInstanceLog" >
- <id name="id">
- <generator class="native"/>
- </id>
- <property name="processInstanceId"/>
- <property name="processId"/>
- <property name="start" type="timestamp" column="START_DATE"/>
- <property name="end" type="timestamp" column="END_DATE"/>
- </class>
-
- <class name="org.jbpm.process.audit.NodeInstanceLog" >
- <id name="id">
- <generator class="native"/>
- </id>
- <property name="type"/>
- <property name="nodeInstanceId"/>
- <property name="nodeId"/>
- <property name="nodeName"/>
- <property name="processInstanceId"/>
- <property name="processId"/>
- <property name="date" type="timestamp" column="LOG_DATE"/>
- </class>
-
-</hibernate-mapping>
View
31 jbpm-bam/src/test/filtered-resources/META-INF/persistence.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.0"
+<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testDS1</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
@@ -22,20 +22,23 @@
<class>org.jbpm.marshalling.util.MarshalledData</class>
<properties>
- <property name="hibernate.max_fetch_depth" value="3"/>
+ <property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
-
- <property name="hibernate.dialect" value="${maven.hibernate.dialect}"/>
+ <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.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}" />
- <!-- neccessary when testing db2 -->
- <property name="hibernate.default_schema" value="${maven.jdbc.schema}" />
+ <!-- neccessary when testing db2 -->
+ <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" />
+ <!-- The following line is what's used in Hibernate 4 instead of a TransactionManagerLookup class -->
+ <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
View
38 jbpm-bam/src/test/filtered-resources/hibernate.cfg.xml
@@ -1,38 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
-
- <session-factory>
-
- <!-- Database connection settings -->
- <property name="connection.driver_class">${maven.jdbc.driver.class}</property>
- <property name="connection.url">${maven.jdbc.url}</property>
- <property name="connection.username">${maven.jdbc.username}</property>
- <property name="connection.password">${maven.jdbc.password}</property>
-
- <!-- JDBC connection pool (use the built-in) -->
- <property name="connection.pool_size">1</property>
-
- <!-- SQL dialect -->
- <property name="dialect">${maven.hibernate.dialect}</property>
-
- <!-- Enable Hibernate's automatic session context management -->
- <property name="current_session_context_class">thread</property>
-
- <!-- Disable the second-level cache -->
- <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
-
- <!-- Echo all executed SQL to stdout -->
- <property name="show_sql">false</property>
-
- <!-- Drop and re-create the database schema on startup -->
- <property name="hbm2ddl.auto">update</property>
-
- <mapping resource="AuditLog.hbm.xml"/>
-
- </session-factory>
-
-</hibernate-configuration>
View
38 jbpm-bam/src/test/java/org/jbpm/process/audit/ProcessInstanceDbLogTest.java
@@ -1,38 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jbpm.process.audit;
-
-import org.jbpm.process.audit.ProcessInstanceDbLog;
-import org.jbpm.process.audit.ProcessInstanceLog;
-import org.junit.Ignore;
-
-
-@Ignore
-public class ProcessInstanceDbLogTest {
-
- public static final void main(String[] args) {
- try {
- System.out.println("Checking process instances for process 'com.sample.ruleflow'");
- for (ProcessInstanceLog processInstance: ProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow")) {
- System.out.println(processInstance);
- }
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
-}
View
40 jbpm-bam/src/test/java/org/jbpm/process/audit/WorkingMemoryDbLoggerTest.java
@@ -25,17 +25,24 @@
import java.util.List;
import java.util.Properties;
+import javax.transaction.TransactionManager;
+
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.SessionConfiguration;
import org.drools.StatefulSession;
import org.drools.compiler.PackageBuilder;
import org.drools.rule.Package;
+import org.hibernate.service.jta.platform.internal.TransactionManagerAccess;
+import org.hibernate.transaction.TransactionManagerLookup;
import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import bitronix.tm.BitronixTransactionManager;
+import bitronix.tm.TransactionManagerServices;
+
/**
* This class tests the following classes:
* <ul>
@@ -67,7 +74,7 @@ public void testLogger1() {
properties.put("drools.processSignalManagerFactory", "org.jbpm.process.instance.event.DefaultSignalManagerFactory");
SessionConfiguration config = new SessionConfiguration(properties);
StatefulSession session = ruleBase.newStatefulSession(config, createEnvironment(context));
- new WorkingMemoryDbLogger(session);
+ new JPAWorkingMemoryDbLogger(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
// start process instance
@@ -75,7 +82,7 @@ public void testLogger1() {
System.out.println("Checking process instances for process 'com.sample.ruleflow'");
List<ProcessInstanceLog> processInstances =
- ProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow");
+ JPAProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow");
assertEquals(1, processInstances.size());
ProcessInstanceLog processInstance = processInstances.get(0);
System.out.println(processInstance);
@@ -83,7 +90,7 @@ public void testLogger1() {
assertNotNull(processInstance.getEnd());
assertEquals(processInstanceId, processInstance.getProcessInstanceId());
assertEquals("com.sample.ruleflow", processInstance.getProcessId());
- List<NodeInstanceLog> nodeInstances = ProcessInstanceDbLog.findNodeInstances(processInstanceId);
+ List<NodeInstanceLog> nodeInstances = JPAProcessInstanceDbLog.findNodeInstances(processInstanceId);
assertEquals(6, nodeInstances.size());
for (NodeInstanceLog nodeInstance: nodeInstances) {
System.out.println(nodeInstance);
@@ -91,7 +98,10 @@ public void testLogger1() {
assertEquals("com.sample.ruleflow", processInstance.getProcessId());
assertNotNull(nodeInstance.getDate());
}
- ProcessInstanceDbLog.clear();
+ JPAProcessInstanceDbLog.clear();
+
+ BitronixTransactionManager txm = TransactionManagerServices.getTransactionManager();
+ assertTrue("There is still a transaction running!", txm.getCurrentTransaction() == null );
}
@Test
@@ -104,7 +114,7 @@ public void testLogger2() {
properties.put("drools.processSignalManagerFactory", "org.jbpm.process.instance.event.DefaultSignalManagerFactory");
SessionConfiguration config = new SessionConfiguration(properties);
StatefulSession session = ruleBase.newStatefulSession(config, createEnvironment(context));
- new WorkingMemoryDbLogger(session);
+ new JPAWorkingMemoryDbLogger(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
// start process instance
@@ -113,19 +123,22 @@ public void testLogger2() {
System.out.println("Checking process instances for process 'com.sample.ruleflow'");
List<ProcessInstanceLog> processInstances =
- ProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow");
+ JPAProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow");
assertEquals(2, processInstances.size());
for (ProcessInstanceLog processInstance: processInstances) {
System.out.print(processInstance);
System.out.println(" -> " + processInstance.getStart() + " - " + processInstance.getEnd());
- List<NodeInstanceLog> nodeInstances = ProcessInstanceDbLog.findNodeInstances(processInstance.getProcessInstanceId());
+ List<NodeInstanceLog> nodeInstances = JPAProcessInstanceDbLog.findNodeInstances(processInstance.getProcessInstanceId());
for (NodeInstanceLog nodeInstance: nodeInstances) {
System.out.print(nodeInstance);
System.out.println(" -> " + nodeInstance.getDate());
}
assertEquals(6, nodeInstances.size());
}
- ProcessInstanceDbLog.clear();
+ JPAProcessInstanceDbLog.clear();
+
+ BitronixTransactionManager txm = TransactionManagerServices.getTransactionManager();
+ assertTrue("There is still a transaction running!", txm.getCurrentTransaction() == null );
}
@Test
@@ -138,7 +151,7 @@ public void testLogger3() {
properties.put("drools.processSignalManagerFactory", "org.jbpm.process.instance.event.DefaultSignalManagerFactory");
SessionConfiguration config = new SessionConfiguration(properties);
StatefulSession session = ruleBase.newStatefulSession(config, createEnvironment(context));
- new WorkingMemoryDbLogger(session);
+ new JPAWorkingMemoryDbLogger(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
// start process instance
@@ -146,7 +159,7 @@ public void testLogger3() {
System.out.println("Checking process instances for process 'com.sample.ruleflow2'");
List<ProcessInstanceLog> processInstances =
- ProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow2");
+ JPAProcessInstanceDbLog.findProcessInstances("com.sample.ruleflow2");
assertEquals(1, processInstances.size());
ProcessInstanceLog processInstance = processInstances.get(0);
System.out.print(processInstance);
@@ -155,7 +168,7 @@ public void testLogger3() {
assertNotNull(processInstance.getEnd());
assertEquals(processInstanceId, processInstance.getProcessInstanceId());
assertEquals("com.sample.ruleflow2", processInstance.getProcessId());
- List<NodeInstanceLog> nodeInstances = ProcessInstanceDbLog.findNodeInstances(processInstanceId);
+ List<NodeInstanceLog> nodeInstances = JPAProcessInstanceDbLog.findNodeInstances(processInstanceId);
for (NodeInstanceLog nodeInstance: nodeInstances) {
System.out.print(nodeInstance);
System.out.println(" -> " + nodeInstance.getDate());
@@ -164,7 +177,10 @@ public void testLogger3() {
assertNotNull(nodeInstance.getDate());
}
assertEquals(14, nodeInstances.size());
- ProcessInstanceDbLog.clear();
+ JPAProcessInstanceDbLog.clear();
+
+ BitronixTransactionManager txm = TransactionManagerServices.getTransactionManager();
+ assertTrue("There is still a transaction running!", txm.getCurrentTransaction() == null );
}
private static RuleBase createKnowledgeBase() {
View
18 jbpm-bpmn2/pom.xml
@@ -170,22 +170,4 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>hibernate-4</id>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
</project>
View
15 jbpm-bpmn2/src/test/filtered-resources/META-INF/persistence.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.0"
+<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testDS1</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
@@ -25,14 +25,19 @@
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
-
<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}" />
+
+ <!-- neccessary when testing db2 -->
+ <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" />
</properties>
</persistence-unit>
</persistence>
View
1  jbpm-examples/pom.xml
@@ -90,6 +90,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
View
30 jbpm-examples/src/main/resources/META-INF/persistence.xml
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm
- http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
+<persistence version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
@@ -12,7 +10,6 @@
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/ProcessEngineDS</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.SessionInfo</class>
@@ -23,13 +20,19 @@
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
+
+ <!-- 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" />
+
+ <!-- The following line is what's used in Hibernate 4 instead of a TransactionManagerLookup class -->
+ <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
</properties>
</persistence-unit>
<persistence-unit name="org.jbpm.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
+
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
@@ -53,16 +56,21 @@
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
+
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- <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.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" 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"/>
+
+ <!-- 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" />
</properties>
</persistence-unit>
View
30 jbpm-gwt/jbpm-gwt-console-server/pom.xml
@@ -24,6 +24,12 @@
<dependency>
<groupId>org.jboss.bpm</groupId>
<artifactId>activity-monitor-model</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.bpm</groupId>
@@ -50,12 +56,16 @@
<artifactId>jbpm-persistence-jpa</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
</dependency>
<!-- provided (by container at runtime) -->
@@ -139,18 +149,6 @@
</archive>
</configuration>
</execution>
- <execution>
- <id>as5</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/gwt-console-server-as5.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
</executions>
</plugin>
</plugins>
View
49 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/gwt-console-server-as5.xml
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-
- <!-- Note: This works on jboss-as-5.1 -->
- <id>AS5</id>
- <formats>
- <format>war</format>
- </formats>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}/upacked-war</directory>
- <outputDirectory>/</outputDirectory>
- <excludes>
- <exclude>WEB-INF/classes/META-INF/persistence.xml</exclude>
-
- <!-- possible signature info -->
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.RSA</exclude>
-
- <!-- jars -->
- <exclude>WEB-INF/lib/netty-*.jar</exclude>
- <exclude>WEB-INF/lib/hornetq-*.jar</exclude>
-
- <!-- hibernate 3 transitive deps -->
- <exclude>WEB-INF/lib/hibernate*.jar</exclude>
-
- <!-- others -->
- <exclude>WEB-INF/lib/xml-apis-*.jar</exclude>
- <exclude>WEB-INF/lib/ejb3-persistence-1.0.2.GA.jar</exclude>
- <exclude>WEB-INF/lib/javassist-3.4.GA.jar</exclude>
- <exclude>WEB-INF/lib/javassist-3.14.0-GA.jar</exclude>
-
- </excludes>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>src/main/assembly/resources/gwt-console-server-persistence-JPA1.xml</source>
- <destName>WEB-INF/classes/META-INF/persistence.xml</destName>
- </file>
- </files>
-
-</assembly>
View
38 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/resources/gwt-console-server-persistence-JPA1.xml
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm
- http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
-
- <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
- <mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
-
- <class>org.drools.persistence.info.SessionInfo</class>
- <class>org.drools.persistence.info.WorkItemInfo</class>
-
- <class>org.jbpm.process.audit.ProcessInstanceLog</class>
- <class>org.jbpm.process.audit.NodeInstanceLog</class>
- <class>org.jbpm.process.audit.VariableInstanceLog</class>
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <!-- hbm2ddl.auto MUST BE update! The console will otherwise overwrite the schema with each new thread -->
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
-
- <!-- for AS7 -->
- <!--property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" /-->
- <!-- for AS5 -->
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
- </properties>
- </persistence-unit>
-
-</persistence>
View
13 jbpm-gwt/jbpm-gwt-console-server/src/main/assembly/resources/gwt-console-server-persistence-JPA2.xml
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="2.0"
+<persistence
+ version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
- <mapping-file>META-INF/JBPMorm-JPA2.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfoMapping-JPA2.xml</mapping-file>
+ <mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
+ <class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
+
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
@@ -23,7 +25,6 @@
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<!-- 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" />
View
21 jbpm-gwt/jbpm-gwt-console-server/src/main/resources/META-INF/persistence.xml
@@ -1,33 +1,34 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8"?>
<persistence
- version="1.0"
- xsi:schemaLocation=
- "http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm
- http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
+ version="2.0"
+ xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jdbc/testDS1</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
+
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
+
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
+
+ <!-- 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.JBossAppServerJtaPlatform" />
</properties>
</persistence-unit>
View
23 jbpm-gwt/jbpm-gwt-core/pom.xml
@@ -166,6 +166,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-persistence-jpa</artifactId>
<scope>test</scope>
@@ -183,22 +188,4 @@
</dependency>
</dependencies>
- <profiles>
- <profile>
- <id>hibernate-4</id>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
</project>
View
79 jbpm-gwt/jbpm-gwt-core/src/test/filtered-resources/META-INF/persistence.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.0"
+<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testDS1</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
@@ -21,24 +21,30 @@
<class>org.jbpm.marshalling.util.MarshalledData</class>
- <properties>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
-
- <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}" />
- </properties>
+ <properties>
+ <property name="hibernate.max_fetch_depth" value="3"/>
+ <property name="hibernate.hbm2ddl.auto" value="update" />
+ <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}" />
+
+ <!-- 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" -->
+
+ <!-- The following line is what's used in Hibernate 4 instead of a TransactionManagerLookup class -->
+ <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
+ </properties>
</persistence-unit>
- <persistence-unit name="org.jbpm.task">
+ <persistence-unit name="org.jbpm.task" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
+
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
@@ -62,25 +68,30 @@
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
+
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- <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.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" 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"/>
+
+ <!-- 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" />
</properties>
</persistence-unit>
- <persistence-unit name="org.jbpm.persistence.local" transaction-type="JTA">
+ <persistence-unit name="org.jbpm.persistence.local" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/jbpm-local-ds</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
+
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
@@ -116,17 +127,19 @@
<class>org.jbpm.marshalling.util.MarshalledData</class>
<properties>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
-
- <property name="hibernate.dialect" value="${maven.hibernate.dialect}"/>
+ <property name="hibernate.max_fetch_depth" value="3"/>
+ <property name="hibernate.hbm2ddl.auto" value="update" />
+ <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.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}" />
+
+ <!-- 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" />
</properties>
</persistence-unit>
View
55 jbpm-gwt/jbpm-gwt-core/src/test/resources/META-INF/JBPMorm.xml
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
- version="1.0">
- <named-query name="ProcessInstancesWaitingForEvent">
- <query>
-select
- processInstanceInfo.processInstanceId
-from
- ProcessInstanceInfo processInstanceInfo join processInstanceInfo.eventTypes eventTypes
-where
- eventTypes = :type
- </query>
- </named-query>
-
- <!-- ProcessInstanceInfo mapping override placeholder (needed for JPA 2) -->
- <!--:JPA2 REMOVE ME:
- <entity class="org.jbpm.persistence.processinstance.ProcessInstanceInfo"
- metadata-complete="true">
- <pre-update method-name="update" />
- <attributes>
- <id name="processInstanceId">
- <column name="InstanceId" />
- <generated-value strategy="AUTO"/>
- </id>
- <basic name="processId" access="FIELD" />
- <basic name="startDate" access="FIELD" >
- <temporal>DATE</temporal>
- </basic>
- <basic name="lastReadDate" access="FIELD" >
- <temporal>DATE</temporal>
- </basic>
- <basic name="lastModificationDate" access="FIELD" >
- <temporal>DATE</temporal>
- </basic>
- <basic name="state" access="FIELD" />
- <basic name="processInstanceByteArray" access="FIELD" >
- <lob/>
- </basic>
- <version name="version" access="FIELD" >
- <column name="OPTLOCK" />
- </version>
- <element-collection name="eventTypes" target-class="java.lang.String" access="FIELD" >
- <collection-table name="EventTypes">
- <join-column name="InstanceId"/>
- </collection-table>
- </element-collection>
- <transient name="processInstance" />
- <transient name="env" />
- </attributes>
- </entity>
- :JPA2 REMOVE ME:-->
-
-</entity-mappings>
View
34 jbpm-human-task/jbpm-human-task-core/pom.xml
@@ -21,8 +21,9 @@
</dependency>
<dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
@@ -48,14 +49,14 @@
</dependency>
<!-- Testing -->
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>test</scope>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>test</scope>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
@@ -102,21 +103,4 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>hibernate-4</id>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
</project>
View
2  ...sk/jbpm-human-task-core/src/main/java/org/jbpm/task/service/persistence/TaskLocalTransactionManager.java
@@ -61,7 +61,7 @@ public void commit(EntityManager em, boolean txOwner) {
}
public void rollback(EntityManager em, boolean txOwner) {
- if( getStatus(em) == Status.STATUS_NO_TRANSACTION ) {
+ if( getStatus(em) == TransactionManager.STATUS_NO_TRANSACTION ) {
return;
}
View
4 jbpm-human-task/jbpm-human-task-core/src/main/resources/META-INF/TaskEventsorm.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
- version="1.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
<named-query name="TaskEventsByTaskId">
<query>
select te
View
4 jbpm-human-task/jbpm-human-task-core/src/main/resources/META-INF/Taskorm.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
- version="1.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
<named-query name="TasksAssignedAsBusinessAdministrator">
<query>
select
View
20 jbpm-human-task/jbpm-human-task-core/src/test/filtered-resources/META-INF/persistence.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.0"
+<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<persistence-unit name="org.jbpm.task" transaction-type="${maven.tx.type}">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
@@ -63,15 +64,20 @@
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
+ <!-- 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" />
+
<!-- needed for JTA testing
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
+ <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
-->
</properties>
</persistence-unit>
<persistence-unit name="org.jbpm.persistence.example">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
+
<class>org.jbpm.task.service.persistence.variable.MyEntity</class>
+
<properties>
<property name="hibernate.dialect" value="${maven.hibernate.dialect}" />
<property name="hibernate.connection.driver_class" value="${maven.jdbc.driver.class}" />
@@ -82,10 +88,10 @@
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
-
- <!-- needed for JTA testing
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
- -->
+
+ <!-- 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" />
+
</properties>
</persistence-unit>
View
16 jbpm-human-task/jbpm-human-task-war/pom.xml
@@ -84,12 +84,12 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <scope>runtime</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <scope>runtime</scope>
+ <scope>test</scope>
</dependency>
</dependencies>
@@ -151,18 +151,6 @@
</archive>
</configuration>
</execution>
- <execution>
- <id>as5</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/human-task-war-as5.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
</executions>
</plugin>
</plugins>
View
47 jbpm-human-task/jbpm-human-task-war/src/main/assembly/human-task-war-as5.xml
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-
- <!-- Note: This works on jboss-as-5.1 -->
- <id>AS5</id>
- <formats>
- <format>war</format>
- </formats>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}/upacked-war</directory>
- <outputDirectory>/</outputDirectory>
- <excludes>
- <exclude>WEB-INF/classes/META-INF/persistence.xml</exclude>
- <exclude>WEB-INF/lib/netty-*.jar</exclude>
- <exclude>WEB-INF/lib/hornetq-*.jar</exclude>
-
- <!-- possible signature info -->
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.RSA</exclude>
-
- <!-- hibernate 3 transitive deps -->
- <exclude>WEB-INF/lib/hibernate*.jar</exclude>
-
- <!-- other -->
- <exclude>WEB-INF/lib/xml-apis-*.jar</exclude>
- <exclude>WEB-INF/lib/ejb3-persistence-1.0.2.GA.jar</exclude>
- <exclude>WEB-INF/lib/javassist-3.4.GA.jar</exclude>
- <exclude>WEB-INF/lib/javassist-3.14.0-GA.jar</exclude>
-
- </excludes>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>src/main/assembly/resources/ht-persistence-JPA1.xml</source>
- <destName>WEB-INF/classes/META-INF/persistence.xml</destName>
- </file>
- </files>
-
-</assembly>
View
42 jbpm-human-task/jbpm-human-task-war/src/main/assembly/resources/ht-persistence-JPA1.xml
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
- <persistence-unit name="org.jbpm.task" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <non-jta-data-source>java:jboss/datasources/jbpmDS</non-jta-data-source>
- <mapping-file>META-INF/Taskorm.xml</mapping-file>
- <class>org.jbpm.task.Attachment</class>
- <class>org.jbpm.task.BooleanExpression</class>
- <class>org.jbpm.task.Comment</class>
- <class>org.jbpm.task.Content</class>
- <class>org.jbpm.task.Deadline</class>
- <class>org.jbpm.task.Delegation</class>
- <class>org.jbpm.task.EmailNotification</class>
- <class>org.jbpm.task.EmailNotificationHeader</class>
- <class>org.jbpm.task.Escalation</class>
- <class>org.jbpm.task.Group</class>
- <class>org.jbpm.task.I18NText</class>
- <class>org.jbpm.task.Notification</class>
- <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
- <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
- <class>org.jbpm.task.PeopleAssignments</class>
- <class>org.jbpm.task.Reassignment</class>
- <class>org.jbpm.task.Status</class>
- <class>org.jbpm.task.SubTasksStrategy</class>
- <class>org.jbpm.task.Task</class>
- <class>org.jbpm.task.TaskData</class>
- <class>org.jbpm.task.User</class>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
- </properties>
- </persistence-unit>
-</persistence>
View
20 jbpm-human-task/jbpm-human-task-war/src/main/resources/META-INF/persistence.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
+<persistence
+ version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/persistence">
+
<persistence-unit name="org.jbpm.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:jboss/datasources/jbpmDS</non-jta-data-source>
@@ -32,12 +33,15 @@
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.User</class>
+
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
+
+ <!-- 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" />
</properties>
</persistence-unit>
</persistence>
View
32 jbpm-human-task/jbpm-human-task-war/src/test/resources/META-INF/persistence.xml
@@ -1,14 +1,16 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
+ version="2.0"
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
+
<persistence-unit name="org.jbpm.task.test">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
+
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
@@ -32,16 +34,22 @@
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
+
<properties>
+ <property name="hibernate.connection.autocommit" value="false" />
+
+ <property name="hibernate.max_fetch_depth" value="3"/>
+ <property name="hibernate.hbm2ddl.auto" value="create" />
+ <property name="hibernate.show_sql" value="false" />
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
+
+ <!-- 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.connection.autocommit" value="false" />
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.hbm2ddl.auto" value="create" />
- <property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
View
14 jbpm-installer/build.xml
@@ -23,20 +23,6 @@
<property name="freemarker.download.url" value="https://repository.jboss.org/nexus/content/repositories/central/org/freemarker/freemarker/2.3.19/freemarker-2.3.19.jar"/>
<property name="jboss.logging.download.url" value="https://repository.jboss.org/nexus/content/groups/public/org/jboss/logging/jboss-logging/3.1.2.GA/jboss-logging-3.1.2.GA.jar"/>
- <path id="generate.ddl.JPA1.class.path">
- <fileset dir="${install.home}/runtime">
- <include name="**/*.jar"/>
- <exclude name="jbpm-test-*.jar"/>
- </fileset>
- <fileset dir="${install.home}/db/driver">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${install.home}/lib/ddl-dependencies">
- <include name="hibernate-tools3.jar"/>
- <include name="freemarker-*.jar"/>
- </fileset>
- </path>
-
<path id="generate.ddl.JPA2.class.path">
<fileset dir="${install.home}/runtime">
<include name="*.jar"/>
View
36 jbpm-installer/db/ProcessInstanceInfo.hbm.xml
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
-<hibernate-mapping package="org.jbpm.persistence.processinstance">
-
- <!-- access="field" for fields that have no setter methods -->
- <class name="ProcessInstanceInfo" table="ProcessInstanceInfo">
-
- <id name="processInstanceId" type="long" column="InstanceId">
- <generator class="native" />
- </id>
-
- <version name="version" type="integer" unsaved-value="null" access="field">
- <column name="OPTLOCK" not-null="false" />
- </version>
-
- <property name="processId" access="field" />
- <property name="startDate" type="timestamp" access="field" />
- <property name="lastReadDate" type="timestamp" access="field" />
- <property name="lastModificationDate" type="timestamp" access="field" />
- <property name="state" type="integer" not-null="true" access="field" />
-
- <property name="processInstanceByteArray" type="org.hibernate.type.PrimitiveByteArrayBlobType"
- column="processInstanceByteArray" access="field" length="2147483647" />
-
- <set name="eventTypes" table="EventTypes" access="field" >
- <key column="InstanceId"/>
- <element column="element" type="string"/>
- </set>
-
- <!-- NOT mapping [processInstance] field because field is transient -->
- <!-- NOT mapping [env] field because field is transient -->
-
- </class>
-
-</hibernate-mapping>
View
41 jbpm-installer/db/ProcessInstanceInfoMapping.xml
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
- version="2.0">
- <entity class="org.jbpm.persistence.processinstance.ProcessInstanceInfo"
- metadata-complete="true">
- <pre-update method-name="update" />
- <attributes>
- <id name="processInstanceId">
- <column name="InstanceId" />
- <generated-value strategy="AUTO"/>
- </id>
- <basic name="processId" access="FIELD" />
- <basic name="startDate" access="FIELD" >
- <temporal>TIMESTAMP</temporal>
- </basic>
- <basic name="lastReadDate" access="FIELD" >
- <temporal>TIMESTAMP</temporal>
- </basic>
- <basic name="lastModificationDate" access="FIELD" >
- <temporal>TIMESTAMP</temporal>
- </basic>
- <basic name="state" access="FIELD" />
- <basic name="processInstanceByteArray" access="FIELD" >
- <lob/>
- </basic>
- <version name="version" access="FIELD" >
- <column name="OPTLOCK" />
- </version>
- <element-collection name="eventTypes" target-class="java.lang.String" access="FIELD" >
- <collection-table name="EventTypes">
- <join-column name="InstanceId"/>
- </collection-table>
- </element-collection>
- <transient name="processInstance" />
- <transient name="env" />
- </attributes>
- </entity>
-
-</entity-mappings>
View
39 jbpm-installer/db/jbpm-persistence-JPA1.xml
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm
- http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
-
- <persistence-unit name="org.jbpm.persistence.jpa.ddl" transaction-type="JTA">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
- <mapping-file>META-INF/JBPMorm.xml</mapping-file>
- <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
-
- <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
- <class>org.drools.persistence.info.SessionInfo</class>
- <class>org.drools.persistence.info.WorkItemInfo</class>
-
- <class>org.jbpm.process.audit.ProcessInstanceLog</class>
- <class>org.jbpm.process.audit.NodeInstanceLog</class>
- <class>org.jbpm.process.audit.VariableInstanceLog</class>
-
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <!-- hbm2ddl.auto MUST BE update! The console will otherwise overwrite the schema with each new thread -->
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.show_sql" value="false" />
-
- <!-- for AS7 -->
- <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" />
- <!-- for AS5 -->
- <!-- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /> -->
- </properties>
- </persistence-unit>
-
-</persistence>
View
47 jbpm-installer/db/task-persistence-JPA1.xml
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
- <persistence-unit name="org.jbpm.task.ddl">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <mapping-file>META-INF/Taskorm.xml</mapping-file>
- <class>org.jbpm.task.Attachment</class>
- <class>org.jbpm.task.Content</class>
- <class>org.jbpm.task.BooleanExpression</class>
- <class>org.jbpm.task.Comment</class>
- <class>org.jbpm.task.Deadline</class>
- <class>org.jbpm.task.Comment</class>
- <class>org.jbpm.task.Deadline</class>
- <class>org.jbpm.task.Delegation</class>
- <class>org.jbpm.task.Escalation</class>
- <class>org.jbpm.task.Group</class>
- <class>org.jbpm.task.I18NText</class>
- <class>org.jbpm.task.Notification</class>
- <class>org.jbpm.task.EmailNotification</class>
- <class>org.jbpm.task.EmailNotificationHeader</class>
- <class>org.jbpm.task.PeopleAssignments</class>
- <class>org.jbpm.task.Reassignment</class>
- <class>org.jbpm.task.Status</class>
- <class>org.jbpm.task.Task</class>
- <class>org.jbpm.task.TaskData</class>
- <class>org.jbpm.task.SubTasksStrategy</class>
- <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
- <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
- <class>org.jbpm.task.User</class>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
- <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
- <property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.connection.autocommit" value="false" />
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.hbm2ddl.auto" value="create" />
- <property name="hibernate.show_sql" value="false" />
- </properties>
- </persistence-unit>
-</persistence>
View
30 jbpm-installer/task-service/resources/META-INF/persistence.xml
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<persistence version="1.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
- http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/persistence">
+<persistence
+ version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
+ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/persistence">
+
<persistence-unit name="org.jbpm.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
+
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
@@ -32,16 +34,22 @@
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
+
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
- <property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
+
+ <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
+ <property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+
+ <!-- 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" />
</properties>
+
</persistence-unit>
</persistence>
View
11 jbpm-persistence-jpa/pom.xml
@@ -28,10 +28,6 @@
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -60,6 +56,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
@@ -162,7 +163,7 @@
<directory>${basedir}</directory>
<includes>
<include>btm*</include>
- <include>JPADroolsFlow.*.db</include>
+ <include>*.db</include>
</includes>
</fileset>
</filesets>
View
50 jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/processinstance/ProcessInstanceInfo.java
@@ -1,47 +1,33 @@
package org.jbpm.persistence.processinstance;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
+import java.io.*;
+import java.util.*;
-import javax.persistence.PreUpdate;
+import javax.persistence.*;
import org.drools.common.InternalKnowledgeRuntime;
import org.drools.common.InternalRuleBase;
import org.drools.event.ProcessEventSupport;
import org.drools.impl.InternalKnowledgeBase;
import org.drools.impl.StatefulKnowledgeSessionImpl;
-import org.drools.marshalling.impl.MarshallerReaderContext;
-import org.drools.marshalling.impl.MarshallerWriteContext;
-import org.drools.marshalling.impl.PersisterHelper;
-import org.drools.marshalling.impl.ProtobufMarshaller;
-import org.kie.runtime.Environment;
-import org.kie.runtime.process.ProcessInstance;
-import org.jbpm.marshalling.impl.JBPMMessages;
-import org.jbpm.marshalling.impl.ProcessInstanceMarshaller;
-import org.jbpm.marshalling.impl.ProcessMarshallerRegistry;
-import org.jbpm.marshalling.impl.ProtobufRuleFlowProcessInstanceMarshaller;
+import org.drools.marshalling.impl.*;
+import org.jbpm.marshalling.impl.*;
import org.jbpm.process.instance.context.variable.VariableScopeInstance;
import org.jbpm.process.instance.impl.ProcessInstanceImpl;
+import org.kie.runtime.Environment;
+import org.kie.runtime.process.ProcessInstance;
-/**
- * This is the object that contains the
- * marshalled byte stream of information representing the
- * ProcessInstance class.
- *
- * Because of Hibernate 3.3.x/3.4.x <-> 4.x compatibility issues,
- * the mapping for this class has been moved to
- */
+@Entity
+@SequenceGenerator(name="processInstanceInfoIdSeq", sequenceName="PROCESS_INSTANCE_INFO_ID_SEQ")
public class ProcessInstanceInfo{
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator="processInstanceInfoIdSeq")
+ @Column(name = "InstanceId")
private Long processInstanceId;
+ @Version
+ @Column(name = "OPTLOCK")
private int version;
private String processId;
@@ -49,13 +35,19 @@
private Date lastReadDate;
private Date lastModificationDate;
private int state;
-
+
+ @Lob
+ @Column(length=2147483647)
byte[] processInstanceByteArray;
+ @ElementCollection
+ @CollectionTable(name="EventTypes", joinColumns=@JoinColumn(name="InstanceId"))
private Set<String> eventTypes = new HashSet<String>();
+ @Transient
ProcessInstance processInstance;
+ @Transient
Environment env;
protected ProcessInstanceInfo() {
View
17 jbpm-persistence-jpa/src/main/resources/META-INF/JBPMorm-JPA2.xml
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
- version="2.0">
- <named-query name="ProcessInstancesWaitingForEvent">
- <query>
-select
- processInstanceInfo.processInstanceId
-from
- ProcessInstanceInfo processInstanceInfo join processInstanceInfo.eventTypes eventTypes
-where
- eventTypes = :type
- </query>
- </named-query>
-
-</entity-mappings>
View
10 jbpm-persistence-jpa/src/main/resources/META-INF/JBPMorm.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
- version="1.0">
+<entity-mappings
+ version="2.0"
+ xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="