Win a copy of The Java Performance Companion this week in the Performance 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