This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages 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