Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PrePassivate and PostActivate

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I would like to know one thing from people who have already worked on EJB's. Do we open and lose database connections in these container callbacks??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think that's mainly what there are here for. It allows the bean to open/close resources after/before activation/passivation.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But imagine, I have 1000 clients or perhaps even more that are accessing my bean and the conversation is going to be very long. Now if in this case what happens when all of them open/close connections?? Isn't that overkill?? Am I wrong in this sense??
 
Pawel Dolega
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not openning / closing the connection but rather taking it / giving it back into the pool. On the other hand there might be something wrong with your design if you have enormous number of statefull session bean instances at a time...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic