posted 18 years ago
This is just an extension to Paul message.
If bean is in Transaction, Container does not persist the bean or remove bean from pool, even you set timeout. Use web containter maintain the session invalidation to solve this problem.
Or you can keep the wait time in session bean, you can know when the session begins transaction by checking afterBegin() method of SessionSynchronization interface (In case of CMP only). Wait for certain time and roll back transaction EJBContext.setRollbackOnly().
In case of BMT you can roolback your tranasaction by explicitly calling rollback after certain time.
Using session management at webcontainer level is better stretegy.