diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-04-22 03:42:51 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-04-22 03:42:51 +0000 |
commit | d6535edfe399ad3f2cd5801f3e1dae0c3f1f80a6 (patch) | |
tree | 911b5c8ab066f7d4e4325f2c337a639e861629bd /src/main | |
parent | e9c05f115bad5d88f1ad44f544ba8b469971293b (diff) |
Added docs regarding trigger's transaction.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/amazon/carbonado/Trigger.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/Trigger.java b/src/main/java/com/amazon/carbonado/Trigger.java index 6b7f9ea..df737e8 100644 --- a/src/main/java/com/amazon/carbonado/Trigger.java +++ b/src/main/java/com/amazon/carbonado/Trigger.java @@ -32,6 +32,18 @@ package com.amazon.carbonado; * "failed" events are run in the same order that the trigger was registered.
* In other words, the last added trigger is at the outermost nesting level.
*
+ * <p>Triggers always run within the same transaction as the triggering
+ * operation. The exact isolation level and update mode is outside the
+ * trigger's control. If an explicit isolation level or update mode is
+ * required, create a nested transaction within a trigger method. A trigger's
+ * nested transaction can also be defined span the entire triggering operation.
+ * To do this, enter the transaction in the "before" method, but return the
+ * transaction object without exiting it. The "after" method is responsible for
+ * exiting the transaction. It extracts (or simply casts) the transaction from
+ * the state object passed into it. When creating spanning transactions like
+ * this, it is critical that the "failed" method be defined to properly exit
+ * the transaction upon failure.
+ *
* @author Brian S O'Neill
*/
public abstract class Trigger<S> {
|