<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 22 Oct 2008, at 06:12, Dan Allen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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 class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br> It's actually the WarStructure that understands it. ;-)<br> - <a href="http://anonsvn.jboss.org/repos/jbossas/trunk/server/src/main/org/jboss/web/deployers/WARStructure.java" target="_blank">http://anonsvn.jboss.org/repos/jbossas/trunk/server/src/main/org/jboss/web/deployers/WARStructure.java</a><br> </blockquote> <br></div> Ok, then we're going need different components.xml for JBoss 4.2 and JBoss 5.<br> <br> <a href="https://jira.jboss.org/jira/browse/JBSEAM-3579" target="_blank">https://jira.jboss.org/jira/browse/JBSEAM-3579</a><div><div></div><div class="Wj3C7c"></div></div></blockquote><div><br>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't willing or able (such as with JBoss AS 4.2).</div></div></blockquote><div><br></div><div>What? This isn'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't about EMF lookup, it's about whether the container deploys the PU or not (JBoss 4.2 doesn't for a war, whilst JBoss 5 does).</div><br><blockquote type="cite"><div class="gmail_quote"><div><br> </div></div><br clear="all">Just as a side note, it would be really cool if we could have a way to configure the persistence in Seam such that Seam will look for the JNDI name and if that fails, it falls back to having Seam bootstrap the PU. This is a matter of putting both in place and letting Seam pick.<br> <br>&lt;persistence:managed-persistence-context name="entityManager"<br>&nbsp; auto-create="true"<br>&nbsp; persistence-unit-jndi-name="java:/appNamePU"<br>&nbsp; entity-manager-factory="#{entityManagerFactoryUsedIfNecessary}"/><br> <br>&lt;persistence:entity-manager-factory name="entityManagerFactoryUsedIfNecessary"<br>&nbsp; persistence-unit-name="appNamePU"<br>&nbsp; <b>persistence-unit-jndi-name="java:/appNamePU"</b>/><br><br> This is not vetted yet, but by adding the persistence-unit-jndi-name to the entity manager factory, it could disable Seam bootstrapping if the JNDI lookup returns a hit. Then, the managed persistence context goes through similar logic when it is being created.<br> <br>-Dan<br><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'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't hesitate to resend a message if<br>you feel that it did not reach my attention.<br></blockquote></div><br></body></html>