Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stateful DAO

 
jacob deiter
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody can explain how to make DAO as stateful
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I wouldn't. You are now defeating the purpose of a DAO. Now you might hold on to things like an EntityManager or SessionFactory, but not any real application state. If you do, you are opening up a big can of concurrency issues to deal with, that will just make your life real difficult.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic