-
15. Re: Transaction Behavior Question
jaikiran Feb 19, 2010 4:01 PM (in response to jaikiran)jaikiran wrote:
I looked at the JTA spec and its javadocs. I don't see anything which states that the timeout applies only when the tx is in active state. My understanding is that, even if the tx is suspended, the timeout still applies.I just read this JBoss Transactions documentation. It says:
Timeout values can be associated with transactions in order to control their lifetime. If a transaction has not terminated (committed or rolled back) before the timeout value elapses, the transaction system will automatically roll it back
So no mention of special treatment to suspended transactions.
I even read some documentations of other application servers and they too timeout a suspended transaction.
-
16. Re: Transaction Behavior Question
jaikiran Feb 19, 2010 4:06 PM (in response to jaikiran)1 of 1 people found this helpfuljaikiran wrote:
I even read some documentations of other application servers and they too timeout a suspended transaction.
This and this (section Bean-Level Container-Managed Transaction Timeouts)
-
17. Re: Transaction Behavior Question
adinn Feb 22, 2010 3:59 AM (in response to jaikiran)jaikiran wrote:
I looked at the JTA spec and its javadocs. I don't see anything which states that the timeout applies only when the tx is in active state. My understanding is that, even if the tx is suspended, the timeout still applies. That's the behaviour i am seeing currently.
Maybe the JBoss Transactions team has some inputs?
I don't know for sure if there is anything in any spec to suggest that suspending a transaction should also suspend countdown towards its timeout. However, I do know what we do to time them out. We insert newly created transactions in a time-ordered queue tagged with a best-before-date equal to (startTime + timeOut). They get rolled back if timeNow ever exceeds that value, irrespective of whether they are active or suspended. As far as we are concerned they are active all this time. A suspend merely disassociates the transaction from the current thread. It does not change the transaction status.
-
18. Re: Transaction Behavior Question
marklittle Feb 22, 2010 8:31 AM (in response to adinn)Correct. The timeout is associated with the transaction and not the fact that the transaction is associated with an active thread of control. Suspending only changes the thread association: it has no impact on the timeout.1 of 1 people found this helpful -
19. Re: Transaction Behavior Question
andy.miller Feb 22, 2010 11:25 AM (in response to adinn)adinn wrote:
jaikiran wrote:
I looked at the JTA spec and its javadocs. I don't see anything which states that the timeout applies only when the tx is in active state. My understanding is that, even if the tx is suspended, the timeout still applies. That's the behaviour i am seeing currently.
Maybe the JBoss Transactions team has some inputs?
I don't know for sure if there is anything in any spec to suggest that suspending a transaction should also suspend countdown towards its timeout. However, I do know what we do to time them out. We insert newly created transactions in a time-ordered queue tagged with a best-before-date equal to (startTime + timeOut). They get rolled back if timeNow ever exceeds that value, irrespective of whether they are active or suspended. As far as we are concerned they are active all this time. A suspend merely disassociates the transaction from the current thread. It does not change the transaction status.
Thanks for the clarification on the behavior. I made an assumption that was simply wrong. Now, I know how to make work what I want. I was concerned there was a bug, but its not.
-
20. Re: Transaction Behavior Question
andy.miller Feb 22, 2010 11:27 AM (in response to marklittle)mark.little@jboss.com wrote:
Thanks for the confirmation Mark. I now have things working the way I want. Once I realized what the real behavior was, it started to become apparent what transaction attribute annotations I needed.