六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 122|回复: 0

How to deploy the Persistence unit in the global JNDI ?

[复制链接]

升级  6.67%

14

主题

14

主题

14

主题

秀才

Rank: 2

积分
60
 楼主| 发表于 2013-2-7 20:43:40 | 显示全部楼层 |阅读模式
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:

view plaincopy to clipboardprint?
   <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.

http://www.mastertheboss.com/en/jboss-howto/45-jboss-persistence/188-how-to-deploy-the-persistence-unit-in-the-global-jndi-.html
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表