Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

share entitymanager between sessionbeans (jpa)  RSS feed

 
Chris Palau
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just created a DAO for my web application but I have a big problem.

I have a Generic DAO.

I have an Orders DAO that extends from Generic DAO.

I have a Users DAO that extends from Generic DAO.

All are SessionBeans inside an Ejb application.

Generic DAO throught dependency injection obtains an EntityManager.

The problem is every time I inject Orders Dao it creates an EntityManager but if when I call Users Dao it injects another EntityManager so I lose the session scope of the previous EntityManager.

is there any way to share the same EntityManager on all session Beans ?

Thanks

Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!