[jboss-svn-commits] JBL Code SVN: r34768 - labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Aug 17 20:49:26 EDT 2010
Author: mark.proctor at jboss.com
Date: 2010-08-17 20:49:26 -0400 (Tue, 17 Aug 2010)
New Revision: 34768
Modified:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/NamedEntryPoint.java
Log:
JBRULES-2651 Concurrency issue in NamedEntryPoint.insert leads to occasional hanging in Drools
-Fixed the concurrency issue so that the object store is used inside of the lock, instead of outside.
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/NamedEntryPoint.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/NamedEntryPoint.java 2010-08-18 00:43:14 UTC (rev 34767)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/NamedEntryPoint.java 2010-08-18 00:49:26 UTC (rev 34768)
@@ -120,6 +120,8 @@
}
try {
+ this.ruleBase.readLock();
+ this.lock.lock();
this.wm.startOperation();
ObjectTypeConf typeConf = this.typeConfReg.getObjectTypeConf( this.entryPoint,
object );
@@ -140,21 +142,15 @@
if ( dynamic ) {
addPropertyChangeListener( object );
}
- try {
- this.ruleBase.readLock();
- this.lock.lock();
- insert( handle,
- object,
- rule,
- activation );
-
- } finally {
- this.ruleBase.readUnlock();
- this.lock.unlock();
- }
+ insert( handle,
+ object,
+ rule,
+ activation );
return handle;
} finally {
this.wm.endOperation();
+ this.ruleBase.readUnlock();
+ this.lock.unlock();
}
}
More information about the jboss-svn-commits
mailing list