I have a client that does a series of HTTP requests to the server. The server needs to maintain state between this requests, so I have used a Stateful Session EJB. In between requests the client does some processing before continuing. There is no user interaction required, though the user may cancel the process.
If the user cancels, or there is a processing error, or connection timeout, etc. I want to remove the stateful session bean since the state is no longer required. The client will start another session instead of resuming.
So how can I set a timeout for removal of the stateful session bean? For example, if there has been 90 seconds of idle time on the use of the bean I would like it to be removed, and thereby freeing the resources that are no longer needed.
P.S. I don't have control over the client, so I can't get the client to remove the session. I must do it from server side.