Hi all, I am using stateful session bean and BMT to manage my transaction. I am keeping an open transaction in one of my method. I am expecting the user to call a second method to commit/rollback the transaction. Now, If the user doesn't call the second method, I am setting the transaction timeout. I want the transaction to be discarded if the user doesn't call the second method by 5 seconds. I am expecting the same behavior as the rollback(). Now, though my transaction times out, it doesn't release the locks on db / other resources like it does in case of roll back. Now, What is the difference between timeout and rollback? How can I discard my transaction if user doesn't call the second method??(should i use timer service!!)
Joined: Mar 19, 2005
I am really sorry for multiple posts...there were some problem with my connection and i was getting the failure notice while my posts were going ok... sorry again. sajid
The general behaviour of transaction timeout is, it should rollback the transaction. You should make sure that you have set timeout for transaction before you begin it.. This is what the behaviour of J2EE SDK, Weblogic.. But I am not sure how other containers implement this.. It makes me sense that all containers should do the same behaviour. Also I am not sure whether this has been defined in EJB spec or not. We can verify by glancing spec once..