This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2.1 - stateless ejbCreate doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 2.1 - stateless ejbCreate doubt" Watch "EJB 2.1 - stateless ejbCreate doubt" New topic
Author

EJB 2.1 - stateless ejbCreate doubt

Luciano A. Pozzo
Ranch Hand

Joined: Jun 20, 2005
Posts: 112
What is better? and why?

1 DAO initialization inside of ejbCreate



2 DAO initialization in the construtor or member variables declaration



3 Calling the DAO factory everytime that I need execute a DAO method




Thank's
prasad kulkarni
Ranch Hand

Joined: Mar 19, 2006
Posts: 66
Use third approach, which is more suitable & preferable. Also use singleton patteren for the DAO layer, so that there will only one instance per jvm for a DAO class.


scjp, scwcd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 2.1 - stateless ejbCreate doubt
 
Similar Threads
why ejbCreate can't be invoked?
EJB Stateless Session Bean with DAOs
stateless Session Bean Thread safety issue
JBoss 5.1 ejbCreate method not called on mdb
Help me see if possible Generic DAO Factory