Subject | Re: Can I create a trigger for insert, update, delete and a transaction commit? |
---|---|
Author | un_spoken |
Post date | 2013-02-06T13:51:07Z |
> The purpose of transactions is to isolate the current task of the current user from all other transactions. The CURRENT_TRANSACTION value for the transaction that reads it is that (and only that) isolated transaction.Thank you Helen.
>
However, this qoute from online help worries me:
"Unlike CURRENT_CONNECTION, it is incremented with every new transaction, whether the client reads the value or not. "
Because it suggest that if I have two transactions, like this:
(I don't know how the below asci is displayed, it should be readable in Currier New font) where:
T1, T2 - transactions
S - transaction start
C - transaction commit
U - an update performed in trigger, the number above "U" is the internal read of CURRENT_TRANSACTION
<----> - a timeline.
S 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 C
T1 <-U-U-U-U-U-U-U-U-U-U-U-U-U-U-U-U-U->
S C
T2 <--something happens-->
I do not know if the above example is easy to understand... But what I want to know is do the second transaction T2 will affect the read of CURRENT_TRANSACTION in a update trigger in T1?
Or the read of CURRENT_TRANSACTION in the above example will always return 1 regardless of how many other trasactions had been executed?
Could you reassure me that it always show "1" ?
regards :)