[
http://jira.jboss.com/jira/browse/JBSEAM-1160?page=all ]
Gavin King closed JBSEAM-1160.
------------------------------
Fix Version/s: 1.3.0.ALPHA
Resolution: Done
Assignee: Gavin King
I don't love this, but I've implemented it....
EMF implicit lookup/resolve precedence
--------------------------------------
Key: JBSEAM-1160
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1160
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Reporter: Christian Bauer
Assigned To: Gavin King
Fix For: 1.3.0.ALPHA
Currently impossible to use WAR deployment and Unit testing. Only way to configure it is
as follows:
<core:managed-persistence-context name="entityManager"
auto-create="true"
entity-manager-factory="#{wikiEntityManagerFactory}"
persistence-unit-jndi-name="java:/EntityManagerFactories/wiki">
</core:managed-persistence-context>
<core:entity-manager-factory installed="@seamPersistenceUnit@"
name="wikiEntityManagerFactory" persistence-unit-name="wiki"/>
<core:ejb installed="@embeddedEjb@"/>
So either the EMF is started by Seam during WAR deployment (seamPersistenceUnit) and
available as a component instance in application scope, or the EMF is deployed by the
E-EJB3 container and bound to JNDI with the magic JBoss configuration property in
persistence.xml.
The managed-persistence-context now needs to access the EMF polymorphically, no matter
where it is bound. If you try the above code, you will see that the entity-manager-factory
attribute always has precedence, and if it resolves to null, you get an NPE. Instead, the
JNDI lookup should be attempted.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira