Rollback on exception in commitIfLocked.
@@ -324,19 +324,25 @@ public abstract class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
/** {@inheritDoc} */
@Override public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner) {
+ if (!hasWriteKey(entry.txKey()))
+ return false;
+
try {
- if (hasWriteKey(entry.txKey())) {
commitIfLocked();
return true;
}
- }
catch (IgniteCheckedException e) {
U.error(log, "Failed to commit remote transaction: " + this, e);
- }
+
+ invalidate(true);
+ systemInvalidate(true);
+
+ rollbackRemoteTx();
return false;
}
+ }
/** {@inheritDoc} */
@Override public boolean isStarted() {
