| If a stateful session bean is in a transaction, then it cannot timeout. So, if a transaction is running for too long (maybe hung), then will the sessions ever be passivated? |
|
It depends on whether the transaction is being coordinated by the built-in JTS or ITS. The lightweight transaction engine that ships with the Container does not support transaction timeouts. Thus, once you start a transaction and use a session bean, that bean will not be passivated (or timeout) until the transaction completes. ITS does support transaction timeouts. There is a way to set the system default timeout and a global maximum timeout. You will have to consult the Borland AppServer User's Guide or EJB Programmer's Guide for details. Thus, using ITS, session beans will timeout after the user transaction times out (t1), then after the session bean passivates (t2), and then after the session bean times out (t3). So an unused session bean, in an idle transaction, will be removed after no more than t1 + t2 + t3 seconds
|