With your change, how do you prevent two JTA transactions from using the same block of sequence ids?
One way would be to ensure that the JTA transaction only succeeds if the obtained block of sequenced ids didn't get used by another JTA transaction. This would be a very bad way though, as suddenly the application would see failures every time two different overlapping JTA transactions obtain a new block of sequence ids that is already in use.
T1 gets an initial block of sequence ids { 0-99 }
T2 gets an initial block also {100-199}
T1 runs out of sequence ids and gets a new block {200-299} T2 runs out of sequence ids and gets a new block {200-299}
which is also in use already by T1
Am I missing something?
|