Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

statefull session bean  RSS feed

 
kri shan
Ranch Hand
Posts: 1487
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the statefull session beans deployment descriptor, i mentioned session timeout 20 secs. But my Transaction is running more than 20 secs.. Whether it throws System exception / Application exception ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your bean is not going to time out while it is active. The container only removes inactive session beans after the specified time out period.
 
Mohana Murali
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!