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

Statless Session Remove method

 
Jared Ladner
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm studying for the SCBCD exam and have a question.

Stateless Session Bean. The create() method will only return a reference to the bean created by the container. Only calling a business method on it will pull it out of the pool. Calling remove() will do nothing b/c the container already sent it to the pool after the method ended, so i still have the object on the client and the container still has the instances in the pool.

Question: Can i call remove() on the Stateless session bean, then call a business method without it throwing javax.ebj.RemoveException?

I know this bad programming. Just trying to make it clear.

Thanks
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jared Ladner,

calling remove on stateless session bean doesnt mean anything. you can call remove() and then you can call a business method on it. But you really dont know which bean is assigned by the container to process the business method. we are not sure whether the bean you called remove() on is same bean that is used to process your business method call.

And assume that the same bean being targetted for both calls(first remove, then business method) but still it shouldn't throw an exception unless bean is timed out and removed from the pool.

Thanks,
Ugender
 
Jared Ladner
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the insight!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic