This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 2.1 - stateless ejbCreate doubt

 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic