hlship 2004/08/19 15:28:56
Modified: . status.xml
framework/src/java/org/apache/hivemind/impl/servicemodel
PooledServiceModel.java
Log:
[HIVEMIND-44] Fix broken synchronization in ThreadedServiceModel and
PooledServiceModel that could make them randomly fail when creating a service
by invoking a factory.
Revision Changes Path
1.50 +4 -0 jakarta-hivemind/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/status.xml,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- status.xml 19 Aug 2004 13:46:42 -0000 1.49
+++ status.xml 19 Aug 2004 22:28:56 -0000 1.50
@@ -76,6 +76,10 @@
<action type="add" dev="HLS" due-to="Naresh Sikha"
fixes-bug="HIVEMIND-36">
Add polling methods to BeanFactory.
</action>
+ <action type="fix" dev="HLS" due-to="James Carman"
fixes-bug="HIVEMIND-44">
+ Fix broken synchronization in ThreadedServiceModel and
PooledServiceModel that could make them
+ randomly fail when creating a service by invoking a factory.
+ </action>
</release>
<release version="1.0-beta-2" date="Aug 1 2004">
1.8 +8 -7
jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/servicemodel/PooledServiceModel.java
Index: PooledServiceModel.java
===================================================================
RCS file:
/home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/servicemodel/PooledServiceModel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PooledServiceModel.java 18 Aug 2004 19:34:12 -0000 1.7
+++ PooledServiceModel.java 19 Aug 2004 22:28:56 -0000 1.8
@@ -110,10 +110,8 @@
public synchronized Object getService()
{
- if (_activeService == null)
+ if (_notifier == null)
{
- _activeService = new ThreadLocal();
-
Module module = getServicePoint().getModule();
_notifier =
@@ -128,9 +126,9 @@
return _serviceProxy;
}
- /**
- * Constructs the service proxy and returns it, wrapped in any
interceptors.
- */
+ /**
+ * Constructs the service proxy and returns it, wrapped in any
interceptors.
+ */
private Object constructServiceProxy()
{
if (_log.isDebugEnabled())
@@ -148,8 +146,11 @@
return addInterceptors(proxy);
}
- public Object getServiceImplementationForCurrentThread()
+ public synchronized Object getServiceImplementationForCurrentThread()
{
+ if (_activeService == null)
+ _activeService = new ThreadLocal();
+
PooledService pooled = (PooledService) _activeService.get();
if (pooled == null)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]