[jbpm-commits] JBoss JBPM SVN: r6852 - in jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm: svc and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 1 09:59:14 EST 2010
Author: alex.guizar at jboss.com
Date: 2010-12-01 09:59:13 -0500 (Wed, 01 Dec 2010)
New Revision: 6852
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceService.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/svc/Services.java
Log:
remove redundant HibernateSaveOperation from Services.defaultSaveOperations; newly created ProcessInstance objects are persisted during construction via Services.assignId()
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceService.java 2010-12-01 14:34:59 UTC (rev 6851)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceService.java 2010-12-01 14:59:13 UTC (rev 6852)
@@ -34,9 +34,7 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import org.hibernate.engine.SessionFactoryImplementor;
-
import org.jbpm.JbpmException;
-import org.jbpm.persistence.JbpmPersistenceException;
import org.jbpm.persistence.db.DbPersistenceService;
public class JtaDbPersistenceService extends DbPersistenceService {
@@ -70,15 +68,16 @@
public void beginTransaction() {
try {
- JtaDbPersistenceServiceFactory jtaFactory = (JtaDbPersistenceServiceFactory) persistenceServiceFactory;
+ JtaDbPersistenceServiceFactory jtaFactory =
+ (JtaDbPersistenceServiceFactory) persistenceServiceFactory;
userTransaction = jtaFactory.getUserTransaction();
userTransaction.begin();
}
catch (NotSupportedException e) {
- throw new JbpmException("transaction is already in course", e);
+ throw new JbpmException("transaction already in course", e);
}
catch (SystemException e) {
- throw new JbpmException("transaction begin failed", e);
+ throw new JbpmException("failed to begin transaction", e);
}
}
@@ -142,7 +141,7 @@
else {
TransactionManager transactionManager = getTransactionManager();
if (transactionManager == null) {
- throw new JbpmPersistenceException("cannot honor rollback request in transaction manager absence");
+ throw new JbpmException("cannot honor rollback request without transaction manager");
}
try {
transactionManager.setRollbackOnly();
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/svc/Services.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/svc/Services.java 2010-12-01 14:34:59 UTC (rev 6851)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/svc/Services.java 2010-12-01 14:59:13 UTC (rev 6852)
@@ -67,14 +67,12 @@
private static final List defaultSaveOperations = createDefaultSaveOperations();
private static List createDefaultSaveOperations() {
- SaveOperation[] operations = new SaveOperation[4];
+ SaveOperation[] operations = new SaveOperation[3];
operations[0] = new CheckUnpersistableVariablesOperation();
- // first, save the execution data (process instance)
- operations[1] = new HibernateSaveOperation();
- // then, insert the logs, which may have references to the execution data
- operations[2] = new SaveLogsOperation();
- // last, save subprocess instances in cascade
- operations[3] = new CascadeSaveOperation();
+ // insert the logs, which may have references to the execution data
+ operations[1] = new SaveLogsOperation();
+ // save subprocess instances in cascade
+ operations[2] = new CascadeSaveOperation();
return Arrays.asList(operations);
}
More information about the jbpm-commits
mailing list