[jbpm-commits] JBoss JBPM SVN: r6414 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jun 14 22:32:49 EDT 2010


Author: rebody
Date: 2010-06-14 22:32:49 -0400 (Mon, 14 Jun 2010)
New Revision: 6414

Modified:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
JBPM-2820 try to handle NPE when using sub-process on DB2 environment.

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2010-06-15 01:58:05 UTC (rev 6413)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2010-06-15 02:32:49 UTC (rev 6414)
@@ -183,7 +183,6 @@
     this.key = key;
 
     save();
-    composeIds();
     
     HistoryEvent.fire(new ProcessInstanceCreate(), this);
   }
@@ -191,7 +190,10 @@
   protected void save() {
     this.dbid = DbidGenerator.getDbidGenerator().getNextId();
     DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
-    if (dbSession!=null) {
+
+    composeIds();
+
+    if (dbSession != null) {
       dbSession.save(this);
     }
   }
@@ -881,13 +883,14 @@
     childExecution.processInstance = this.processInstance;
     childExecution.name = name;
     
+    // composeIds uses the parent so the childExecution has to be added before the ids are composed
+	childExecution.setParent(this);
     childExecution.save();
+
     // make sure that child execution are saved before added to a persistent collection
     // cause of the 'assigned' id strategy, adding the childExecution to the persistent collection 
     // before the dbid is assigned will result in identifier of an instance of ExecutionImpl altered from 0 to x
     addExecution(childExecution);
-    // composeIds uses the parent so the childExecution has to be added before the ids are composed
-    childExecution.composeIds();
 
     log.debug("created "+childExecution);
 



More information about the jbpm-commits mailing list