[jbpm-commits] JBoss JBPM SVN: r3779 - in jbpm3/branches/jbpm-3.2.5.SP/modules/core/src: main/resources/org/jbpm/context/exe and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Feb 4 15:34:27 EST 2009
Author: alex.guizar at jboss.com
Date: 2009-02-04 15:34:27 -0500 (Wed, 04 Feb 2009)
New Revision: 3779
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.properties.mysql.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/TokenVariableMap.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/ProcessInstance.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/RuntimeAction.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Token.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/PooledActor.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm983/JBPM983Test.java
Log:
JBPM-1953 revert r3778; without version checking, jobs get executed more than once
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.properties.mysql.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.properties.mysql.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.properties.mysql.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -7,5 +7,6 @@
<property name="hibernate.connection.url">${jdbc.mysql.url}</property>
<property name="hibernate.connection.username">${jdbc.mysql.username}</property>
<property name="hibernate.connection.password">${jdbc.mysql.password}</property>
+ <property name="hibernate.connection.isolation">2</property>
<property name="hibernate.query.substitutions">true 1, false 0</property>
<!-- JDBC connection properties (end) -->
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/TokenVariableMap.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/TokenVariableMap.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/TokenVariableMap.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -8,9 +8,7 @@
<class name="org.jbpm.context.exe.TokenVariableMap"
table="JBPM_TOKENVARIABLEMAP">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<many-to-one name="token"
column="TOKEN_"
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -10,6 +10,7 @@
abstract="true"
discriminator-value="V">
<id name="id" column="ID_"><generator class="native" /></id>
+ <discriminator type="char" column="CLASS_"/>
<!-- V : org.jbpm.context.exe.VariableInstance -->
<!-- B : org.jbpm.context.exe.variableinstance.ByteArrayInstance -->
<!-- D : org.jbpm.context.exe.variableinstance.DateInstance -->
@@ -20,10 +21,7 @@
<!-- S : org.jbpm.context.exe.variableinstance.StringInstance -->
<!-- N : org.jbpm.context.exe.variableinstance.NullInstance -->
<!-- J : org.jbpm.context.exe.variableinstance.JcrNodeInstance -->
- <discriminator type="char" column="CLASS_"/>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="name" column="NAME_"/>
<property name="converter"
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -7,9 +7,7 @@
<class name="org.jbpm.graph.exe.Comment"
table="JBPM_COMMENT">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="actorId" column="ACTORID_"/>
<property name="time" column="TIME_"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/ProcessInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/ProcessInstance.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/ProcessInstance.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -7,9 +7,7 @@
<class name="org.jbpm.graph.exe.ProcessInstance"
table="JBPM_PROCESSINSTANCE">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="key" column="KEY_" index="IDX_PROCIN_KEY" />
<property name="start" column="START_" />
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/RuntimeAction.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/RuntimeAction.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/RuntimeAction.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -7,9 +7,7 @@
<class name="org.jbpm.graph.exe.RuntimeAction"
table="JBPM_RUNTIMEACTION">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="eventType" column="EVENTTYPE_"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Token.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Token.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/graph/exe/Token.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -7,9 +7,7 @@
<class name="org.jbpm.graph.exe.Token"
table="JBPM_TOKEN">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="name" column="NAME_"/>
<property name="start" column="START_"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -11,9 +11,7 @@
discriminator-value="J">
<id name="id" column="ID_"><generator class="native" /></id>
<discriminator type="char" column="CLASS_"/>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="dueDate" column="DUEDATE_" type="timestamp"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -12,9 +12,7 @@
discriminator-value="M">
<id name="id" column="ID_"><generator class="native" /></id>
<discriminator type="char" column="CLASS_"/>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<!-- M : org.jbpm.module.exe.ModuleInstance -->
<!-- C : org.jbpm.context.exe.ContextInstance -->
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/PooledActor.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/PooledActor.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/PooledActor.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -9,9 +9,7 @@
<class name="org.jbpm.taskmgmt.exe.PooledActor"
table="JBPM_POOLEDACTOR">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="actorId" column="ACTORID_" index="IDX_PLDACTR_ACTID"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -9,9 +9,7 @@
<class name="org.jbpm.taskmgmt.exe.SwimlaneInstance"
table="JBPM_SWIMLANEINSTANCE">
<id name="id" column="ID_"><generator class="native" /></id>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="name" column="NAME_" />
<property name="actorId" column="ACTORID_" />
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml 2009-02-04 20:34:27 UTC (rev 3779)
@@ -11,9 +11,7 @@
discriminator-value="T">
<id name="id" column="ID_"><generator class="native" /></id>
<discriminator type="char" column="CLASS_"/>
- <!-- JBPM-1953 turn off version checking under SOA-P
<version name="version" column="VERSION_" />
- -->
<property name="name" column="NAME_" />
<property name="description" column="DESCRIPTION_" type="text"/>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-02-04 20:34:27 UTC (rev 3779)
@@ -32,10 +32,9 @@
import org.jbpm.job.executor.JobExecutor;
/**
- * Concurrent job executors can process the same job in parallel.
- * The test simulates multiple nodes in the network processing a common job set.
- * The key setting is to give each job executor a different name;
- * normally, a job executor is named after the node's inet address
+ * Concurrent job executors can process the same job in parallel. The test simulates multiple nodes
+ * in the network processing a common job set. The key setting is to give each job executor a
+ * different name; normally, a job executor is named after the node's inet address
*
* https://jira.jboss.org/jira/browse/JBPM-1072
*
@@ -49,28 +48,26 @@
private JobExecutor[] jobExecutors = new JobExecutor[JOB_EXECUTOR_COUNT];
private long processDefinitionId;
- private volatile static int executionCount;
-
private static final String PROCESS_DEFINITION = "<process-definition name='job-executors'>"
- + "<event type='process-end'>"
- + "<action expression='#{eventCallback.processEnd}' />"
- + "</event>"
- + "<start-state name='start-state1'>"
- + "<transition to='Service 1'></transition>"
- + "</start-state>"
- + "<node name='Service 1' async='true'>"
- + "<action class='"
+ + " <event type='process-end'>"
+ + " <action expression='#{eventCallback.processEnd}' />"
+ + " </event>"
+ + " <start-state name='start-state1'>"
+ + " <transition to='Service 1'></transition>"
+ + " </start-state>"
+ + " <node name='Service 1' async='true'>"
+ + " <action class='"
+ Counter.class.getName()
+ "' />"
- + "<transition to='Service 2' />"
- + "</node>"
- + "<node name='Service 2' async='true'>"
- + "<action class='"
+ + " <transition to='Service 2' />"
+ + " </node>"
+ + " <node name='Service 2' async='true'>"
+ + " <action class='"
+ Counter.class.getName()
+ "' />"
- + "<transition to='end-state1' />"
- + "</node>"
- + "<end-state name='end-state1' />"
+ + " <transition to='end-state1' />"
+ + " </node>"
+ + " <end-state name='end-state1' />"
+ "</process-definition>";
@Override
@@ -88,22 +85,21 @@
@Override
protected void tearDown() throws Exception {
stopJobExecutors();
+
graphSession.deleteProcessDefinition(processDefinitionId);
- super.tearDown();
EventCallback.clear();
+ super.tearDown();
}
- public void testMultipleJobExecutors()
- {
- executionCount = 0;
-
+ public void testMultipleJobExecutors() {
// Won't Fix [JBPM-1072] Concurrent JobExecutors can process the same job in parallel
- if (getHibernateDialect().indexOf("HSQL") != -1)
- {
+ if (getHibernateDialect().indexOf("HSQL") != -1) {
return;
}
-
+
+ Counter.resetCount();
+
// kick off process instance
ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
@@ -114,7 +110,7 @@
commitAndCloseSession();
try {
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
- assertEquals(2, executionCount);
+ assertEquals(2, Counter.getCount());
waitForJobs(EventCallback.DEFAULT_TIMEOUT);
}
@@ -125,9 +121,10 @@
private void startJobExecutors() {
for (int i = 0; i < jobExecutors.length; i++) {
- jobExecutors[i] = (JobExecutor) JbpmConfiguration.Configs.getObject("jbpm.job.executor");
- jobExecutors[i].setName("JbpmJobExecutor/" + i);
- jobExecutors[i].start();
+ JobExecutor executor = (JobExecutor) JbpmConfiguration.Configs.getObject("jbpm.job.executor");
+ executor.setName(executor.getName() + '/' + i);
+ executor.start();
+ jobExecutors[i] = executor;
}
}
@@ -142,17 +139,27 @@
}
}
- private static synchronized void incrementCount() {
- ++executionCount;
- }
-
public static class Counter implements ActionHandler {
+ private volatile static int count;
+
private static final long serialVersionUID = 1L;
public void execute(ExecutionContext exeContext) throws Exception {
incrementCount();
exeContext.leaveNode();
}
+
+ public static int getCount() {
+ return count;
+ }
+
+ public static void resetCount() {
+ count = 0;
+ }
+
+ private static synchronized void incrementCount() {
+ ++count;
+ }
}
}
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm983/JBPM983Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm983/JBPM983Test.java 2009-02-04 17:22:47 UTC (rev 3778)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm983/JBPM983Test.java 2009-02-04 20:34:27 UTC (rev 3779)
@@ -148,8 +148,6 @@
ProcessInstance pi = jbpmContext.loadProcessInstance(piId);
assertEquals("end-state-success", pi.getRootToken().getNode().getName());
}
-
- processJobs(30 * 1000);
}
protected void waitFor(long piId) throws Exception {
More information about the jbpm-commits
mailing list