| How to deploy the Persistence unit in the global JNDI ? |
| Written by Mark S. | |||||
|
jboss recipe of the day By default the persistence unit are available in the java: Context. If you wish to make them available also in the global naming Context you have to add two properties to your persistence.xml configuration file:
<persistence>
<persistence-unit name="manager1">
<jta-data-source>java:/MySQLDS</jta-data-source>
<properties>
<property name="jboss.entity.manager.jndi.name" value="java:/Manager1"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/Manager1Factory"/>
</properties>
</persistence-unit>
</persistence>
jboss.entity.manager.jndi.name gives you a transaction scoped entity manager you can interact with, while jboss.entity.manager.factory.jndi.name binds the entity manager factory into global JNDI.
JBoss.org Search
Custom Search
Only registered users can write comments!
Powered by !JoomlaComment 3.26
3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved." |


