You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "David T. Adcox (JIRA)" <tu...@ws.apache.org> on 2007/08/23 16:56:30 UTC
[jira] Created: (TUSCANY-1574)
SDOXSDEcoreBuilder.createResourceSet() is not thread safe
SDOXSDEcoreBuilder.createResourceSet() is not thread safe
---------------------------------------------------------
Key: TUSCANY-1574
URL: https://issues.apache.org/jira/browse/TUSCANY-1574
Project: Tuscany
Issue Type: Bug
Components: Java SDO Implementation
Affects Versions: Java-SDO-1.0
Environment: n/a
Reporter: David T. Adcox
Fix For: Java-SDO-Next
The method createResourceSet() in SDOXSDEcoreBuilder is not thread safe. It performs an enumeration of EPackage resource objects and adds them to the ResourceSet created within the method. The problem is that a ResourceSet object is a container. So, when the Resource objects are added with this statement:
resources.add(resource);
EMF attempts to first unlink the resource from its previous container. That in itself is an issue, but beyond that, during a stress run, the unlinking can occur simultaneously on multiple threads, causing exceptions. This code was added for Tuscany-513. I'm not clear what are the goals, but I was wondering if we can accomplish the same task in another manner. The goal seems to be to expose the newly created ResourceSet to the built-in models. Perhaps this pattern from DataObjectUtil.configureResourceSet would work:
resourceSet.setPackageRegistry(new EPackageRegistryImpl(HelperContextImpl.getBuiltInModelRegistry()));
Would this line of code accomplish a similar function?
--
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
[jira] Updated: (TUSCANY-1574)
SDOXSDEcoreBuilder.createResourceSet() is not thread safe
Posted by "Amita Vadhavkar (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amita Vadhavkar updated TUSCANY-1574:
-------------------------------------
Fix Version/s: (was: Java-SDO-Next)
Java-SDO-1.1
> SDOXSDEcoreBuilder.createResourceSet() is not thread safe
> ---------------------------------------------------------
>
> Key: TUSCANY-1574
> URL: https://issues.apache.org/jira/browse/TUSCANY-1574
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-1.0
> Environment: n/a
> Reporter: David T. Adcox
> Fix For: Java-SDO-1.1
>
> Attachments: 1574.patch
>
>
> The method createResourceSet() in SDOXSDEcoreBuilder is not thread safe. It performs an enumeration of EPackage resource objects and adds them to the ResourceSet created within the method. The problem is that a ResourceSet object is a container. So, when the Resource objects are added with this statement:
> resources.add(resource);
> EMF attempts to first unlink the resource from its previous container. That in itself is an issue, but beyond that, during a stress run, the unlinking can occur simultaneously on multiple threads, causing exceptions. This code was added for Tuscany-513. I'm not clear what are the goals, but I was wondering if we can accomplish the same task in another manner. The goal seems to be to expose the newly created ResourceSet to the built-in models. Perhaps this pattern from DataObjectUtil.configureResourceSet would work:
> resourceSet.setPackageRegistry(new EPackageRegistryImpl(HelperContextImpl.getBuiltInModelRegistry()));
> Would this line of code accomplish a similar function?
--
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
[jira] Updated: (TUSCANY-1574)
SDOXSDEcoreBuilder.createResourceSet() is not thread safe
Posted by "David T. Adcox (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David T. Adcox updated TUSCANY-1574:
------------------------------------
Attachment: 1574.patch
This patch embodies the changes described in the body of this JIRA.
> SDOXSDEcoreBuilder.createResourceSet() is not thread safe
> ---------------------------------------------------------
>
> Key: TUSCANY-1574
> URL: https://issues.apache.org/jira/browse/TUSCANY-1574
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-1.0
> Environment: n/a
> Reporter: David T. Adcox
> Fix For: Java-SDO-Next
>
> Attachments: 1574.patch
>
>
> The method createResourceSet() in SDOXSDEcoreBuilder is not thread safe. It performs an enumeration of EPackage resource objects and adds them to the ResourceSet created within the method. The problem is that a ResourceSet object is a container. So, when the Resource objects are added with this statement:
> resources.add(resource);
> EMF attempts to first unlink the resource from its previous container. That in itself is an issue, but beyond that, during a stress run, the unlinking can occur simultaneously on multiple threads, causing exceptions. This code was added for Tuscany-513. I'm not clear what are the goals, but I was wondering if we can accomplish the same task in another manner. The goal seems to be to expose the newly created ResourceSet to the built-in models. Perhaps this pattern from DataObjectUtil.configureResourceSet would work:
> resourceSet.setPackageRegistry(new EPackageRegistryImpl(HelperContextImpl.getBuiltInModelRegistry()));
> Would this line of code accomplish a similar function?
--
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
[jira] Resolved: (TUSCANY-1574)
SDOXSDEcoreBuilder.createResourceSet() is not thread safe
Posted by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kelvin Goodson resolved TUSCANY-1574.
-------------------------------------
Resolution: Fixed
Fixed in rev 578054
> SDOXSDEcoreBuilder.createResourceSet() is not thread safe
> ---------------------------------------------------------
>
> Key: TUSCANY-1574
> URL: https://issues.apache.org/jira/browse/TUSCANY-1574
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-1.0
> Environment: n/a
> Reporter: David T. Adcox
> Fix For: Java-SDO-Next
>
> Attachments: 1574.patch
>
>
> The method createResourceSet() in SDOXSDEcoreBuilder is not thread safe. It performs an enumeration of EPackage resource objects and adds them to the ResourceSet created within the method. The problem is that a ResourceSet object is a container. So, when the Resource objects are added with this statement:
> resources.add(resource);
> EMF attempts to first unlink the resource from its previous container. That in itself is an issue, but beyond that, during a stress run, the unlinking can occur simultaneously on multiple threads, causing exceptions. This code was added for Tuscany-513. I'm not clear what are the goals, but I was wondering if we can accomplish the same task in another manner. The goal seems to be to expose the newly created ResourceSet to the built-in models. Perhaps this pattern from DataObjectUtil.configureResourceSet would work:
> resourceSet.setPackageRegistry(new EPackageRegistryImpl(HelperContextImpl.getBuiltInModelRegistry()));
> Would this line of code accomplish a similar function?
--
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