-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Injecting EntityManager or passing it
PostPosted: Wed Apr 03, 2013 4:28 pm 
Newbie

Joined: Wed Feb 27, 2013 2:59 pm
Posts: 6
Hi... design question.

When using a SessionBean and some DAO classes, should i then inject EntityManager in all dao classes or pass it as a variable. ?

My SessionBean is injecting the EntityManager. I have read different opinions about this.
If I use a transaction started in my SessionBean, I would guess I should use the same EntityManager in that transaction. ? Hence passing it to the DAO classes. ?

Or can the container keep track of it if I inject my DAO classes and inject the EntityManager in the DAO class, and do not pass it ??


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.