public final class PingPongTransactionChain extends Object implements DOMTransactionChain
DOMTransactionChain, which has a very specific behavior, which some users may find
surprising. If keeps the general intent of the contract, but it makes sure there are never more than two transactions
allocated at any given time: one of them is being committed, and while that is happening, the other one acts as
a scratch pad. Once the committing transaction completes successfully, the scratch transaction is enqueued as soon as
it is ready.
This mode of operation means that there is no inherent isolation between the front-end transactions and transactions cannot be reasonably cancelled.
It furthermore means that the transactions returned by newReadOnlyTransaction() counts as an outstanding
transaction and the user may not allocate multiple read-only transactions at the same time.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
DOMDataTreeReadTransaction |
newReadOnlyTransaction()
Create a new read only transaction which will continue the chain.
|
DOMDataTreeReadWriteTransaction |
newReadWriteTransaction()
Create a new read-write transaction which will continue the chain.
|
DOMDataTreeWriteTransaction |
newWriteOnlyTransaction()
Create a new write-only transaction which will continue the chain.
|
public void close()
close in interface AutoCloseableclose in interface org.opendaylight.yangtools.concepts.Registrationpublic DOMDataTreeReadTransaction newReadOnlyTransaction()
DOMTransactionChain
The previous write transaction has to be either SUBMITTED (commit was
invoked) or CANCELLED (close was invoked).
The returned read-only transaction presents an isolated view of the data if the previous write transaction was successful - in other words, this read-only transaction will see the state changes made by the previous write transaction in the chain. However, state which was introduced by other transactions outside this transaction chain after creation of the previous transaction is not visible.
newReadOnlyTransaction in interface DOMTransactionChainnewReadOnlyTransaction in interface DOMTransactionFactorypublic DOMDataTreeReadWriteTransaction newReadWriteTransaction()
DOMTransactionChain
The previous write transaction has to be either SUBMITTED (commit was
invoked) or CANCELLED (close was invoked).
The returned read-write transaction presents an isolated view of the data if the previous write transaction was successful - in other words, this read-write transaction will see the state changes made by the previous write transaction in the chain. However, state which was introduced by other transactions outside this transaction chain after creation of the previous transaction is not visible.
Committing this read-write transaction using commit will commit
the state changes in this transaction to be visible to any subsequent transaction in this chain and also to any
transaction outside this chain.
newReadWriteTransaction in interface DOMTransactionChainnewReadWriteTransaction in interface DOMTransactionFactorypublic DOMDataTreeWriteTransaction newWriteOnlyTransaction()
DOMTransactionChain
The previous write transaction has to be either SUBMITTED (commit was
invoked) or CANCELLED (close was invoked)
The returned write-only transaction presents an isolated view of the data if the previous write transaction was successful - in other words, this write-only transaction will see the state changes made by the previous write transaction in the chain. However, state which was introduced by other transactions outside this transaction chain after creation of the previous transaction is not visible
Committing this write-only transaction using commit will commit
the state changes in this transaction to be visible to any subsequent transaction in this chain and also to any
transaction outside this chain.
newWriteOnlyTransaction in interface DOMTransactionChainnewWriteOnlyTransaction in interface DOMTransactionFactoryCopyright © 2019 OpenDaylight. All rights reserved.