* See the file LICENSE for redistribution information.
* Copyright (c) 2002, 2013 Oracle and/or its affiliates. All rights reserved.
WARNING: This interface is not currently supported. This means that, on a replica where transactions may be rolled back without a full environment shutdown, the repeatXxx methods cannot be used to handle this circumstance. To be safe, it is best to only use TransactionTrigger methods, namely TransactionTrigger.commit.
WARNING: Only transient triggers are currently supported, and the documention below has not yet been updated to reflect this fact. See details at the top of Trigger.java.
The trigger methods can be invoked in one of two circumstances:
These trigger methods are only invoked if the partial transactions contain operations associated with triggers.Consider a transaction consisting of two put operations:
put k1 put k2 commit tIn the absence of a replica or master failure this would normally result in the sequence of trigger calls:
Trigger.put(t, k1, ...) Trigger.put(t, k2,....) Trigger.commit(t)If the replica failed in the midst of the transaction replay, immediately after the first put operation, the sequence of trigger invocations before the replica went down would be:
Trigger.put(k1, ...)followed by the trigger calls below when the replica handle was subsequently reopened:
ReplicatedTrigger.repeat(t) Trigger.repeatPut(t, k1, ...) Trigger.put(t, k2, ...) Trigger.commit(t)The interface defines one "repeat" trigger method for each of the trigger methods defined by Trigger. The methods are distinct from those defined by Trigger to highlight the fact that the trigger method is being invoked a second time for the same operation and the trigger method may not have completed the actions it intended to take when it was invoked the first time. For example, the trigger method may have been used to update a couple of local indexes and it was only finished with updating one local index and persisting it before the replica crashed. As a result the method may need to take special action to repair state maintained by it.
A ReplicatedTrigger is associated with a replicated database via
. For a replicated
database, the ReplicatedTrigger interface must be implemented for all
triggers. For a non-replicated database, implementing the ReplicatedTrigger
interface is allowed, but the ReplicatedTrigger methods will not be called.
Trigger.putmethod in that it omits the
Trigger.deletemethod in that it omits the