|
Patrick Linskey made changes - 22/Feb/07 10:08 PM
I think the FIXME part of the patch should be removed/simplified. The patch itself contains comments like the following:
// we don't need to synchronize on brokers since one JTA transaction // can never be active on multiple concurrent threads. Yet the FIXME part explicitly guards against having the same transaction on concurrent threads. If guards like this are necessary, then they need to be consistent throughout the patch. But if we agree that the comment above is correct and the same transaction can't be active on multiple threads, then the FIXME part is useless. Oops, FIXME is stale -- the comment is no longer applicable. Disregard. (In an earlier revision, I was guarding 'brokers' with a synchronized block, but analyzed further and decided that indeed, it was not necessary.)
The code in question (just after the FIXME) is still guarding against the same transaction in concurrent threads. See the "someone beat us to it" putIfAbsent call. If we agree that transactions are thread bound -- as must be the case for the rest of the patch to be correct -- no one can "beat us to it", because we're the only thread with access to that transaction.
Good point -- I guess we can switch to just using a put() call instead. I'll change accordingly.
New patch that doesn't use putIfAbsent()
Patrick Linskey made changes - 23/Feb/07 04:27 PM
Patrick Linskey made changes - 23/Feb/07 06:34 PM
Patrick Linskey made changes - 01/Mar/07 02:13 AM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Barring any objections, I plan to commit this change in the next day or so.