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

ejbRemove??

 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when i call remove on a session bean?Is bean instance in server destroyed?OR is the implementation server specific?
 
Karan V Praba
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
The session object will be removed (object no longer available) from the client and it will throw an exception if the client invokes any method after the remove method. (Internally life cycle of bean will be ended).
 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks karan for that response
 
Brian Stelzer
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The actual instance may or may not be deleted from the pool for efficiency sake. To the user, it appears that it has been removed, but inside the server, it probably wouldn't make sense to destroy the instance and have to recreate an object. It probably would use the same instance and reinitialize. For instance, take a stateless session bean, I set some instance variables for example( bad programming ), I end my client program, I start up the client program again or any other client program, and I create an same type of stateless session bean as before, now the first thing I do is read the instance variable, its entirely possible to get the old value back. Now stateful session beans are slightly different, there data is passivated. When you remove the data is basically lost, but the actual instance or object is put back into the pool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic