diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2012-10-12 18:06:02 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2012-10-12 18:06:02 +0000 |
commit | 906f9cdc014b251ce951f7d0a3fb5967c7153c98 (patch) | |
tree | 8cbdd4b1c4f5678ace2b1fcd7d7146f02d152ca7 /src/main | |
parent | 5e9e820b1703c54ee7886062174977a90689b503 (diff) |
Triggers now run in a for-update transaction.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | 6 |
1 files changed, 6 insertions, 0 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..adf11ba 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java +++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java @@ -3294,6 +3294,7 @@ public final class StorableGenerator<S extends Storable> { // txn = null;
// } else {
// txn = support.getRootRepository().enterTransaction();
+ // txn.setForUpdate(true);
// tryStart:
// if (forTry) {
// state = trigger.beforeTryXxx(this);
@@ -3321,6 +3322,11 @@ public final class StorableGenerator<S extends Storable> { b.invokeInterface(mSupportType, "getRootRepository", repositoryType, null);
b.invokeInterface(repositoryType, ENTER_TRANSACTION_METHOD_NAME, transactionType, null);
b.storeLocal(txnVar);
+ // txn.setForUpdate(true);
+ b.loadLocal(txnVar);
+ b.loadConstant(true);
+ b.invokeInterface(transactionType, SET_FOR_UPDATE_METHOD_NAME, null,
+ new TypeDesc[] {TypeDesc.BOOLEAN});
Label tryStart = b.createLabel().setLocation();
|