public class SnapshotJTransaction extends JTransaction
JTransactionthat persists indefinitely.
SnapshotJTransactions hold a "snapshot" some portion of the state of a
JTransaction for later use.
SnapshotJTransaction contains its own set of "snapshot"
JObjects that are (usually) copies of
the corresponding "real" database
JObjects. Because a
lives indefinitely, these objects can be used just like normal Java objects, outside of any regular transaction.
Permazen features such as indexing, listeners, validation, etc. also continue to work normally.
More general usage is possible via
For example, for
KVDatabases that support it, using the key/value store snapshot returned by
KVTransaction.mutableSnapshot() allows an efficient copying of the entire database.
|Modifier and Type||Method and Description|
Commit this transaction.
Determine whether this instance is a
Determine whether this transaction is still valid.
Delete all objects contained in this snapshot transaction and reset it back to its initial state.
Roll back this transaction.
cascadeFindAll, cascadeFindAll, copyTo, copyTo, copyTo, copyTo, create, create, createClones, createSnapshotTransaction, delete, exists, followReferencePath, get, get, get, getAll, getCurrent, getKey, getKey, getPermazen, getSchemaVersion, getSnapshotTransaction, getValidationMode, invertReferencePath, performAction, queryCompositeIndex, queryCompositeIndex, queryCompositeIndex, queryIndex, queryIndex, queryListElementIndex, queryMapValueIndex, queryVersion, readCounterField, readListField, readMapField, readSetField, readSimpleField, recreate, registerJObject, resetValidationQueue, revalidate, setCurrent, updateSchemaVersion, validate, writeSimpleField
public boolean isSnapshot()
public SnapshotTransaction getTransaction()
SnapshotTransactionassociated with this instance.
public void reset()
It will contain schema meta-data but no objects.
public void commit()
public void rollback()
Copyright © 2018. All rights reserved.