• 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!