From d6535edfe399ad3f2cd5801f3e1dae0c3f1f80a6 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 22 Apr 2007 03:42:51 +0000 Subject: Added docs regarding trigger's transaction. --- src/main/java/com/amazon/carbonado/Trigger.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/com') 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. * + *

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 { -- cgit v1.2.3