Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove stateful EJB bean in client

Tags:

java

ejb-3.0

I'm currently learning EJB and as I understand when client gets a stateful session bean the server keeps it in memory(or passivates it) until the client removes the bean. Pretty simple, except nowhere I have seen any examples of how the client can actually remove the bean. How do you do that other than shutting down your client application? Or do I just have to implement a reset method in all my stateful beans if I want to start over?

like image 667
palto Avatar asked Jun 08 '10 10:06

palto


1 Answers

If you have a business method that "ends" the flow, annotate it with @Remove. Otherwise provide a "reset()" method with the @Remove annotation.

like image 109
Shimi Bandiel Avatar answered Sep 24 '22 04:09

Shimi Bandiel