<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div class="Ih2E3d"><blockquote type="cite"><div class="gmail_quote">
<div>Yes, in fact with any Java EE 5 container, we should make it a policy in the examples to assume that the container is taking care of the persistence unit rather than Seam. Seam should only step in when the container isn&#39;t willing or able (such as with JBoss AS 4.2).</div>
</div></blockquote><div><br></div></div><div>What? This isn&#39;t something that is mandated by the EE5 spec so how does this work? Looking up the EMF over JNDI only works in JBoss. The problem here isn&#39;t about EMF lookup, it&#39;s about whether the container deploys the PU or not (JBoss 4.2 doesn&#39;t for a war, whilst JBoss 5 does).</div>
</div></div></blockquote><div><br>That&#39;s not true. If defined as persistence-unit-ref in web.xml (I know, silly requirement) a Java EE container will load the persistence unit and make it available in JNDI for that application. <br>
<br>5.3.1 of JPA spec:<br><br>&quot;Within a Java EE environment, an entity manager factory may be injected using the Persistence-Unit annotation or obtained through JNDI lookup.&quot;<br><br>JBoss 4 did not support this. Hibernate on JBoss AS just happens to support putting it in JNDI
defined in a vendor properties (w/o the resource reference).<br><br>-Dan<br></div></div><br>-- <br>Dan Allen<br>Software consultant | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters. &nbsp;Please don&#39;t hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>