Author: alex.guizar(a)jboss.com
Date: 2010-08-27 19:10:10 -0400 (Fri, 27 Aug 2010)
New Revision: 6631
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmContext.java
Log:
JBPM-2911 address possible performance problem caused by autoSaveProcessInstances
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmContext.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmContext.java 2010-08-27
20:04:45 UTC (rev 6630)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmContext.java 2010-08-27
23:10:10 UTC (rev 6631)
@@ -23,9 +23,10 @@
import java.io.Serializable;
import java.sql.Connection;
-import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
@@ -103,7 +104,7 @@
private final String name;
private final Services services;
private final JbpmConfiguration jbpmConfiguration;
- private List autoSaveProcessInstances;
+ private Set autoSaveProcessInstances;
private boolean isClosed;
/**
@@ -689,7 +690,7 @@
public void addAutoSaveProcessInstance(ProcessInstance processInstance) {
ensureOpen();
- if (autoSaveProcessInstances == null) autoSaveProcessInstances = new ArrayList();
+ if (autoSaveProcessInstances == null) autoSaveProcessInstances = new HashSet();
autoSaveProcessInstances.add(processInstance);
}