Class StagedTransaction
java.lang.Object
com.vaadin.flow.signals.impl.Transaction
com.vaadin.flow.signals.shared.impl.StagedTransaction
- All Implemented Interfaces:
Serializable
A conventional read-write transaction that stages commands to be submitted as
a single commit. Commits by incorporating staged changes into the outer
transaction if it's another staged transaction and otherwise performs a
two-phase commit to atomically apply changes to all participating trees.
Provides repeatable reads that are supplemented by changes from any staged
commands.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.signals.impl.Transaction
Transaction.Type -
Constructor Summary
ConstructorsConstructorDescriptionStagedTransaction(Transaction outer) Creates a new staged transaction for the given outer transaction. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcommit(Consumer<SignalOperation.ResultOrError<Void>> resultHandler) Commits any staged commands in this transaction.voidinclude(SignalTree tree, SignalCommand command, @Nullable CommandsAndHandlers.CommandResultHandler resultHandler, boolean applyToTree) Includes the given command to the given tree in the context of this transaction and optionally also sets the command to be applied to the underlying signal tree.read(SignalTree tree) Gets a revision for reading from the given tree in the context of this transaction.protected voidrollback()Rolls back any staged commands in this transaction and notifies the result handlers for those commands.Methods inherited from class com.vaadin.flow.signals.impl.Transaction
createWriteThrough, getCurrent, include, inExplicitTransaction, inTransaction, runInTransaction, runInTransaction, runInTransaction, runInTransaction, runWithoutTransaction, runWithoutTransaction, setTransactionFallback
-
Constructor Details
-
StagedTransaction
Creates a new staged transaction for the given outer transaction.- Parameters:
outer- the outer transaction to wrap, notnull
-
-
Method Details
-
commit
Description copied from class:TransactionCommits any staged commands in this transaction.- Specified by:
commitin classTransaction- Parameters:
resultHandler- a consumer to update the result value in the corresponding transaction operation, notnull
-
rollback
protected void rollback()Description copied from class:TransactionRolls back any staged commands in this transaction and notifies the result handlers for those commands.- Specified by:
rollbackin classTransaction
-