[ 
https://issues.apache.org/jira/browse/TUSCANY-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hasan Muhammad updated TUSCANY-1130:
------------------------------------

    Attachment: 1130.patch
                HelperContextMultiThreadedTestCase.java

Frank,

I agree that synching the HashMap would create performance problems. The 
problem seems to be only because multiple threads are accessing 
createHelperContext as you saw, since while defining the EMF types in the 
registry for the ExtendedMetaData, it gets delegated to parent registry which 
is global registry. But once these EMF types are defined (put for HashMap), the 
rest is all (get) and hence there is no problem after that. 

One fix would be to simply synch the SDOUtil.createHelperContext(). I made that 
fix in this patch. It works with the multiThreded Test case i have submitted. 

The test case depends on GroboUtils jar, which can be obtained from 
http://groboutils.sourceforge.net/, if you are interested in including into 
tuscany build. This is just a set of extension classes to JUnit which includes 
an extension class to build multi threaded testcases easily.

Hasan

> Concurrent access to SDOUtil.createHelperContext() results in exception
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-1130
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1130
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>             Fix For: Java-M2
>
>         Attachments: 1130.patch, 1130.patch, 1130_final.patch, 
> 1130_new.patch, HelperContextMultiThreadedTestCase.java
>
>
> In tuscany runtime, when multiple apps are started simultaneously, we get an 
> exception as below: This is a problem with acessing 
> SDOUtil.createHelperContext(0 concurrently.
> Exception = java.util.ConcurrentModificationException
> Source = com.ibm.ws.soa.sca.admin.config.loader.SDOLoader.<INIT>
> probeid = 80
> Stack Dump = java.util.ConcurrentModificationException: concurrent access to 
> HashMap attempted by Thread[server.startup : 2,5,main]
>         at java.util.HashMap.onExit(HashMap.java:217)
>         at java.util.HashMap.transfer(HashMap.java:514)
>         at java.util.HashMap.resize(HashMap.java:500)
>         at java.util.HashMap.addEntry(HashMap.java:800)
>         at java.util.HashMap.put(HashMap.java:441)
>         at 
> com.ibm.sdo.internal.ecore.util.BasicExtendedMetaData$EPackageExtendedMetaDataImpl.getType(BasicExtendedMetaData.java:2064)
>         at 
> com.ibm.sdo.internal.ecore.util.BasicExtendedMetaData.getType(BasicExtendedMetaData.java:115)
>         at 
> com.ibm.sdo.internal.xsd.ecore.XSDEcoreBuilder.populateTypeToTypeObjectMap(XSDEcoreBuilder.java:108)
>         at 
> org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.<init>(SDOXSDEcoreBuilder.java:61)
>         at 
> org.apache.tuscany.sdo.helper.XSDHelperImpl.<init>(XSDHelperImpl.java:79)
>         at 
> org.apache.tuscany.sdo.helper.XSDHelperImpl.<init>(XSDHelperImpl.java:94)
>         at 
> org.apache.tuscany.sdo.helper.HelperContextImpl.<init>(HelperContextImpl.java:48)
>         at 
> org.apache.tuscany.sdo.helper.HelperContextImpl.<init>(HelperContextImpl.java:52)
>         at 
> org.apache.tuscany.sdo.util.SDOUtil.createHelperContext(SDOUtil.java:299)

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to