File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion 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