[
https://issues.jboss.org/browse/AS7-5476?page=com.atlassian.jira.plugin.s...
]
Scott Marlow commented on AS7-5476:
-----------------------------------
Status:
I'm trying to understand how much of the code for AS7-5476 is expected to be in AS7
versus the persistence provider that is used with the OSGi persistence bundles. I read
through the OSGi enterprise expert group minutes but didn't get an answer there.
I'm reading through the eg mailing messages to attempt more understanding of the OSGi
r5 intentions for JPA. Later will come discussion/questions...
{quote}
*127.5 JPA Provider*
JPA Providers supply the implementation of the JPA Services and the Persistence Provider
service. It is the responsibility of a JPA Provider to store and retrieve the entity
classes from a relational database. It is the responsibility of the JPA Provider to
register a Persistence Provider and start tracking Persistence Bundles, see Extending a
Persistence Bundle on page 439.
{quote}
Complete support for OSGi JPA
-----------------------------
Key: AS7-5476
URL:
https://issues.jboss.org/browse/AS7-5476
Project: Application Server 7
Issue Type: Feature Request
Components: JPA / Hibernate, OSGi
Reporter: Thomas Diesler
Assignee: Scott Marlow
Fix For: 7.2.0.CR1
h6. 127.3.1 Services
_Entity Manager Factory Builder service_ - The Entity Manager Factory Builder service
provides the capability of creating an EntityManagerFactory object with additional
configuration properties
Add EntityManagerFactory service properties
* osgi.unit.name - The name of the Persistence Unit (done)
* osgi.unit.version - The version of the associated Persistence Bundle
* osgi.unit.provider - The implementation class name of the JPA Provider
h6. 127.3.4 Custom Configured Entity Manager
If a Client Bundle needs to provide configuration properties for the creation of an
Entity Manager Factory it should use the Entity Manager Factory Builder service. This can
for example be used to provide the database selection properties when the Persistence Unit
is incomplete or if the database selection needs to be overridden.
Once an Entity Manager Factory is created the specified Data Source becomes associated
with the Entity Manager Factory. It is therefore not possible to re-associate an Entity
Manager Factory with another Data Source by providing different properties. A JPA Provider
must throw an Exception when an attempt is made to re-specify the database properties.
h6. 127.4.2 Meta Persistence Header
Support non-default persistence descriptors through the Meta-Persistence header
For example: _Meta-Persistence: META-INF/jpa.xml, persistence/jpa.xml_
h6. 127.4.3 Processing
The JPA Provider must validate the Persistence Bundle. A valid Persistence Bundle
must:
* Have no parsing errors of the Persistence Descriptors
* Validate all Persistence Descriptors against their schemas
* Have at least one assigned Persistence Unit
* Have all entity classes mentioned in the assigned Persistence Units on the Persistence
Bundles JAR.
If any validation fails, then this is an error and should be logged. Such a bundle is
ignored completely even if it also contains valid assigned Persistence Units. Only a
bundle update can recover from this
state.
h6. 127.4.8 Stopping
If a Persistence Bundle is being stopped, then the JPA Provider must ensure that any
resources allocated on behalf of the Persistence Bundle are cleaned up and all open
connections are closed. This cleanup must happen synchronously with the STOPPING event.
Any Exceptions being thrown while cleaning up should be logged but must not stop any
further clean up.
If the JPA Provider is being stopped, the JPA Provider must unregister all JPA Services
that it registered through the Persistence Bundles and clean up as if those bundles were
stopped.
h6. 127.5.3 Data Source Factory Service Matching
Providers must use the javax.persistence.jdbc.driver property, as defined in JDBC Access
in JPA on page 406, to obtain a Data Source Factory service. The Data Source Factory is
specified in JDBC Service Specification on page 375. The javax.persistence.jdbc.driver
property must be matched with the value of the Data Source Factory service property named
osgi.jdbc.driver.class.
h6. 127.5.4 Rebinding
In this specification, the Entity Manager Factory service is only registered when the
Persistence Unit is complete and a matching Data Source Factory service is available.
However, the API of the Entity
Manager Factory allows the creation of an Entity Manager with configuration properties.
Those configuration properties could contain the JDBC properties to bind to another Data
Source Factory service than it had already selected.
This case must not be supported by a JPA Provider, an Illegal Argument Exception must be
thrown.
h6. 127.6 Static Access
A Static Persistence Bundle must provide static access from the Persistence class to the
JPA Services.
This issue is complete when the TCK passes
--
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