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!!)
I don't get any exception when the transaction times out. Is it supposed to throw any? Where exactly am i supposed to get the exception?? In the stateful session bean, in my method A , the transaction begins & remains open. In method B, the transaction is supposed to rollback/commit. I am keeping an open transaction across methods. That's not a good idea, I know. But I have to do this. I am expecting if the user doesn't call method B & commits/rollbacks, withing 5 seconds, the transaction be rolled back. But the transaction is not rolling back & holds the lock on database & other resource if user doesn't call method B.
I am using Jboss & mysql. Is this some bug of jboss?? Or my concept is wrong?? regards, Sajid