<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 9 Jan 2012, at 11:43, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 9 Jan 2012, at 13:36, Manik Surtani wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 9 Jan 2012, at 10:50, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 7 Jan 2012, at 18:57, Manik Surtani wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">After spending some hours on ISPN-1284, I think we have a few conceptual problems with using Synchronizations.<div><br></div><div>Here is the topic branch containing my work:</div><div><br></div><div><a href="https://github.com/maniksurtani/infinispan/tree/t_1284">https://github.com/maniksurtani/infinispan/tree/t_1284</a></div><div><br></div><div>So far what I have done is:</div><div><br></div><div>* Changed defaults</div><div>* Changed config validations to emit a warning and disable synchronisations if recovery is enabled</div><div>* Update some tests that rely on XA to specifically set synchronisations to false</div><div><br></div><div>But there are still some issues, and what specifically worry me is behaviour demonstrated by these two test failures:</div><div><br></div><div><div>&nbsp; testModsCommit(org.infinispan.lock.StaleEagerLocksOnPrepareFailureTest)</div><div>&nbsp; testNoModsCommit(org.infinispan.lock.StaleEagerLocksOnPrepareFailureTest)</div></div><div><br></div><div>They both attempt to abort a transaction by throwing an exception during prepare. &nbsp;Now since we use Synchronizations by default, these failures do *not* abort the transaction since it is only seen by the SynchronizationAdapter in afterCommit(). &nbsp;Where does this stand, conceptually? &nbsp;With optimistic transactions, locks may not be able to be acquired at prepare-time. &nbsp;These transactions should fail.</div></div></blockquote>With pessimistic transactions, the first phase of 2PC is skipped: that is because locks are acquired and modifications propagated at this stage. So beforeCompletion doesn't do anything.&nbsp;</div><div>However in the case of optimistic transactions the prepare happens during beforeCompletion and it would fail causing the tx to roll back.<br></div></div></blockquote><div><br></div><div>So Synchronizations and pessimistic locking are incompatible? &nbsp;:)</div></div></div></blockquote>Well this is very similar to what happens in the case of optimistic locking when the &nbsp;CommitCommand cannot be broadcasted: the transaction silently fails.</div></div></blockquote><div><br></div><div>Then the tests need to be re-written in this case, if we make synchronisations a default? :)</div><div><br></div><div>--</div></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div><div><br></div><div>Lead, Infinispan</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>