summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/gen
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2012-11-28 00:50:54 +0000
committerBrian S. O'Neill <bronee@gmail.com>2012-11-28 00:50:54 +0000
commit341e3975fefdf5e2fb9a62cdf762af7738657ee6 (patch)
treec3558c277db94886da9f59c88161fe10f3ad4188 /src/main/java/com/amazon/carbonado/gen
parent6ba986731d5f9f35fd6a9f63d61cbd8288a9c12c (diff)
ReplicatedRepository resync no longer creates a for-update transaction on the master.
Pass transaction to trigger, allowing it to change modes.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/gen')
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorableGenerator.java19
1 files changed, 11 insertions, 8 deletions
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<S extends Storable> {
// 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<S extends Storable> {
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<S extends Storable> {
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);
}