users@glassfish.java.net

Suggestion to EJB3.1; Stateful session bean Time-out mechanism

From: <glassfish_at_javadesktop.org>
Date: Fri, 26 Mar 2010 23:58:48 PDT

I think there is a lack of efficiency in timing issues of the Stateful session beans. The problem is when to remove the Stateful session bean instance completely.

By now, the TimeOut value which can be specified in @StatefulTimeout, as the documentation says, “specifies the amount of time a Stateful session bean can be idle ( not receive any client invocations ) before it is eligible for removal by the container.” No matter it is passivated or not!

For sure, in Passivation process, when the instance state is removed from memory and is passivated into the stream, the importance of removing the instance at the specified time becomes less. Now, the state is persisted and does not consume expensive resources. Therefore, we can wait longer to receive any invocation from client before removing the valuable (from client’s point of view) bean instance completely.

I think the timeout problem can be separated into two parts for better efficiency;
1. Passivation Timeout
The idle time after which the instance state is passivated.

2. Destruction Timeout
The idle time after which the instance state is completely removed. It is the currently implemented mechanism.

Such a mechanism would help the developer to have some control on when to passivate the instance.
For ease of development, as an alternative, the destroy time can be the total number of Passivation Timeout and Destruction Timeout (here it must have another name).

I tried not to go into details too much.

Nice Time
Youness
[Message sent by forum member 'youness_teimoury']

http://forums.java.net/jive/thread.jspa?messageID=393990