Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

persistence unit

 
priyanka kumari
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I would like to know whether there can be more than one persistence unit in an EJBModule? If yes then how can we make use of them.

Thanks
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes we can have more than one Persistent unit.

we can use that like

@PersistenceContext(unitName="ejb3trail")
private EntityManager em;

@PersistenceContext(unitName="ejb3trail2")
private EntityManager em;

you can have both these unitname in your persistent.xml.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic