You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Ron Gavlin (JIRA)" <tu...@ws.apache.org> on 2007/08/07 14:55:59 UTC
[jira] Commented: (TUSCANY-1006)
ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
[ https://issues.apache.org/jira/browse/TUSCANY-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518151 ]
Ron Gavlin commented on TUSCANY-1006:
-------------------------------------
I am working on a test that exposes this problem. Unfortunately, the problem only seems to appear when running on multi-core or multi-cpu systems. As mentioned earlier, the problem results in a runaway thread which is quite problematic especially in server environments. I see 3 solutions:
1. Use backport-util-concurrent ConcurrentHashMap - Pros: 1). very scalable 2). easy to remove when upgrading to JDK 5 Cons: introduces 320k jar dependency to Tuscany SDO
2. Use synchronized HashMap - Pros: available in JDK 1.4 so no add'l jars or custom code needed Cons: not scalable (see http://www.ibm.com/developerworks/java/library/j-jtp07233.html Table 1)
3. Implement custom, thread-safe HashMap - Pros: no add'l jar dependencies Cons: difficult to implement and test well
How should we proceed?
> ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
> ----------------------------------------------------------------------
>
> Key: TUSCANY-1006
> URL: https://issues.apache.org/jira/browse/TUSCANY-1006
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-beta1
> Environment: Sun JDK 1.4.2_11, 2-CPU server
> Reporter: Ron Gavlin
> Priority: Critical
> Fix For: Java-SDO-beta1
>
>
> I have an application in which multiple threads access a shared ChangeSummaryImpl. Each thread invokes ChangeSummaryImpl.getOldValues() repeatedly. This causes one or more of the threads to enter an infinite "while (true) -" loop in HashMap.get(Object) with the following stack trace:
> HashMap.get(Object) line: 323
> ChangeSummaryImpl.getOldValues(DataObject) line: 481
> ...
> I suspect this occurs because the access to HashMap cachedSDOObjectChanges is not synchronized.
> I have been unable as of yet to create a simple test case that demonstrates the problem. In the meantime, I will try to implement a short-term fix by changing line 93 of ChangeSummaryImpl
> from
> protected HashMap cachedSDOObjectChanges = new HashMap();
> to
> protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
> I will let you know if that fixes the problem. Any insight or assistance you can offer concerning this problem is appreciated. This is a show-stopper problem for us.
> Regards,
> - Ron
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org