Class DetachedTransaction

java.lang.Object
io.permazen.core.Transaction
io.permazen.core.DetachedTransaction
All Implemented Interfaces:
Closeable, AutoCloseable

public class DetachedTransaction extends Transaction implements Closeable
A Transaction that is not actually connected to a persistent database, but instead exists just to hold objects in memory.

DetachedTransactions are typically used to hold a "snapshot" some portion of a normal Transaction for later use. As with all transactions, each DetachedTransaction contains its own object data.

DetachedTransactions cannot be committed or rolled-back; they just persist in memory until no longer needed. Transaction.Callbacks may be registered, but they will never be invoked.

DetachedTransactions can be based on an arbitrary KVStore; see Database.createDetachedTransaction().

Lifecycle Management

Instances of this class should be close()'d when no longer needed to release any associated resources.

See Also: