From 341e3975fefdf5e2fb9a62cdf762af7738657ee6 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 28 Nov 2012 00:50:54 +0000 Subject: ReplicatedRepository resync no longer creates a for-update transaction on the master. Pass transaction to trigger, allowing it to change modes. --- .../com/amazon/carbonado/gen/StorableGenerator.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/gen') diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java index 4a0d74e..59312c8 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java +++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java @@ -3296,9 +3296,9 @@ public final class StorableGenerator { // txn = support.getRootRepository().enterTransaction(); // tryStart: // if (forTry) { - // state = trigger.beforeTryXxx(this); + // state = trigger.beforeTryXxx(txn, this); // } else { - // state = trigger.beforeXxx(this); + // state = trigger.beforeXxx(txn, this); // } // } b.loadLocal(triggerVar); @@ -3325,20 +3325,23 @@ public final class StorableGenerator { Label tryStart = b.createLabel().setLocation(); // if (forTry) { - // state = trigger.beforeTryXxx(this); + // state = trigger.beforeTryXxx(txn, this); // } else { - // state = trigger.beforeXxx(this); + // state = trigger.beforeXxx(txn, this); // } b.loadLocal(triggerVar); + b.loadLocal(txnVar); b.loadThis(); if (forTryVar == null) { if (forTry) { b.invokeVirtual(triggerVar.getType(), "beforeTry" + opType, - TypeDesc.OBJECT, new TypeDesc[] {TypeDesc.OBJECT}); + TypeDesc.OBJECT, + new TypeDesc[] {transactionType, TypeDesc.OBJECT}); } else { b.invokeVirtual(triggerVar.getType(), "before" + opType, - TypeDesc.OBJECT, new TypeDesc[] {TypeDesc.OBJECT}); + TypeDesc.OBJECT, + new TypeDesc[] {transactionType, TypeDesc.OBJECT}); } b.storeLocal(stateVar); } else { @@ -3347,13 +3350,13 @@ public final class StorableGenerator { b.ifZeroComparisonBranch(isForTry, "!="); b.invokeVirtual(triggerVar.getType(), "before" + opType, - TypeDesc.OBJECT, new TypeDesc[] {TypeDesc.OBJECT}); + TypeDesc.OBJECT, new TypeDesc[] {transactionType, TypeDesc.OBJECT}); b.storeLocal(stateVar); b.branch(cont); isForTry.setLocation(); b.invokeVirtual(triggerVar.getType(), "beforeTry" + opType, - TypeDesc.OBJECT, new TypeDesc[] {TypeDesc.OBJECT}); + TypeDesc.OBJECT, new TypeDesc[] {transactionType, TypeDesc.OBJECT}); b.storeLocal(stateVar); } -- cgit v1.2.3