John Ross created ARIES-996:
-------------------------------
Summary: JPA does not work for bundles that are constituents of
subsystems.
Key: ARIES-996
URL: https://issues.apache.org/jira/browse/ARIES-996
Project: Aries
Issue Type: Bug
Components: JPA
Reporter: John Ross
The org.apache.aries.jpa.container.context.impl.GlobalPersistenceManager class
creates and manages multiple PersistenceContextManagers across multiple nested
frameworks. More generally, "multiple nested frameworks" can be replaced with
the term "isolation units". There is one PersistenceContextManager per
isolation unit. Currently, the class uses a system bundle as the map key, which
is fine for "multiple nested frameworks" since each nested framework contains
its own system bundle along with a composite bundle. At least two problems
arise when used with Subsystems, however, because there are isolation units
(i.e. subsystems) existing within a single framework.
The first problem is that the system bundle might be hidden from the client
bundle by find hooks. This results in an NPE on line 104 of
GlobalPersistenceManager.registerContext.
The second problem is that even if the first is gotten around by getting the
system bundle by location instead of by ID, duplicate transaction exceptions
occur since there is only one system bundle.
One solution would be to use a bundle tracker that tracks subsystem region
context bundles. This is easily done since all region context bundles have the
same symbolic name prefix per the spec.
GlobalPersistenceManager.registerContext would first iterate over any tracked
region context bundles. If a region context bundle is visible to the client
bundle, then the bundle context of the region context bundle is used. If there
are no region context bundles, or none are visible to the client bundle, then
the system bundle context is used as before.
A more general issue not addressed by this bug is how JPA should function
within a framework isolated by any generic mechanism using hooks. It's not
clear how the bundle context to use would be identified.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira