This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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
 
Have you checked out Aspose?
 
subject: EJB 2.1 - stateless ejbCreate doubt
 
It's not a secret anymore!