
public abstract class OTransactionRealAbstract extends OTransactionAbstract implements OTransactionInternal
OTransactionAbstract.LockedRecordMetadataOTransaction.ISOLATION_LEVEL, OTransaction.TXSTATUS, OTransaction.TXTYPE| Modifier and Type | Field and Description |
|---|---|
protected Map<ORID,ORecordOperation> |
allEntries |
protected Set<ODocument> |
changedDocuments
token This set is used to track which documents are changed during tx, if documents are changed
but not saved all changes are made during tx will be undone.
|
protected int |
id |
protected Map<String,OTransactionIndexChanges> |
indexEntries |
protected int |
newObjectCounter |
protected Map<ORID,List<OTransactionRecordIndexOperation>> |
recordIndexOperations |
protected Map<ORID,ORID> |
updatedRids |
protected Map<String,Object> |
userData |
database, isolationLevel, locks, statusDELETED_RECORD| Modifier | Constructor and Description |
|---|---|
protected |
OTransactionRealAbstract(ODatabaseDocumentInternal database,
int id) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangedDocument(ODocument document)
Adds the given document to a set of changed documents known to this transaction.
|
void |
addIndexEntry(OIndex delegate,
String iIndexName,
OTransactionIndexChanges.OPERATION iOperation,
Object key,
OIdentifiable iValue)
Adds the transactional index entry in this transaction.
|
void |
addIndexEntry(OIndex delegate,
String iIndexName,
OTransactionIndexChanges.OPERATION iOperation,
Object key,
OIdentifiable iValue,
boolean clientTrackOnly)
Bufferizes index changes to be flushed at commit time.
|
protected void |
checkTransaction() |
void |
clearIndexEntries() |
void |
clearRecordEntries() |
void |
close()
Closes the transaction and releases all the acquired locks.
|
Collection<ORecordOperation> |
getCurrentRecordEntries() |
Object |
getCustomData(String iName)
Obtains the custom value by its name stored in the context of this transaction.
|
int |
getEntryCount() |
int |
getId() |
ODocument |
getIndexChanges() |
OTransactionIndexChanges |
getIndexChanges(String iIndexName)
Bufferizes index changes to be flushed at commit time.
|
OTransactionIndexChanges |
getIndexChangesInternal(String indexName)
Does the same thing as
OBasicTransaction.getIndexChanges(String), but handles remote storages in a
special way. |
Map<String,OTransactionIndexChanges> |
getIndexOperations()
Extract all the calculated index operations for the current transaction changes, the key of the
map is the index name the value all the changes for the specified index.
|
List<String> |
getInvolvedIndexes() |
Optional<byte[]> |
getMetadata() |
int |
getNewObjectCounter() |
List<ORecordOperation> |
getNewRecordEntriesByClass(OClass iClass,
boolean iPolymorphic)
Called by class iterator.
|
List<ORecordOperation> |
getNewRecordEntriesByClusterIds(int[] iIds)
Called by cluster iterator.
|
Map<ORID,OTransactionAbstract.LockedRecordMetadata> |
getNoTxLocks() |
ORecord |
getRecord(ORID rid)
Resolves a record with the given RID in the context of this transaction.
|
ORecordOperation |
getRecordEntry(ORID ridPar)
Extract a single change from a specified record id.
|
Collection<ORecordOperation> |
getRecordOperations()
Extract all the record operations for the current transaction
|
Iterator<byte[]> |
getSerializedOperations() |
Map<ORID,ORID> |
getUpdatedRids() |
void |
prepareSerializedOperations() |
void |
resetAllocatedIds() |
void |
restore() |
protected ODocument |
serializeIndexChangeEntry(OTransactionIndexChangesPerKey entry,
ODocument indexDoc) |
void |
setCustomData(String iName,
Object iValue)
Sets the custom value by its name stored in the context of this transaction.
|
void |
setMetadataHolder(Optional<OTxMetadataHolder> metadata) |
void |
setNoTxLocks(Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks) |
void |
storageBegun() |
void |
updateIdentityAfterCommit(ORID oldRid,
ORID newRid)
Notify the transaction for the rid change, the changed will be tracked inside the transaction
and used for remapping links.
|
getDatabase, getInternalLocks, getIsolationLevel, getLockedRecords, getStatus, internalRollback, isActive, isLockedRecord, lockingStrategy, lockRecord, setDatabase, setIsolationLevel, setLocks, trackLockedRecord, trackUnlockRecord, unlockRecord, updateCacheFromEntriesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfill, getDatabase, getLockedRecords, isSequenceTransaction, isUsingLog, setDatabase, setStatusdeleteRecord, getClientTransactionId, isActive, saveRecordamountOfNestedTxs, begin, commit, commit, isUsingLog, loadRecord, loadRecord, loadRecord, loadRecordIfVersionIsNotLatest, reloadRecord, reloadRecord, rollback, rollback, setUsingLogprotected Map<ORID,ORecordOperation> allEntries
protected Map<String,OTransactionIndexChanges> indexEntries
protected Map<ORID,List<OTransactionRecordIndexOperation>> recordIndexOperations
protected int id
protected int newObjectCounter
protected OTransactionRealAbstract(ODatabaseDocumentInternal database, int id)
public void addChangedDocument(ODocument document)
OBasicTransactionaddChangedDocument in interface OBasicTransactiondocument - the document to add.public void close()
OTransactionAbstractclose in interface OTransactionclose in class OTransactionAbstractpublic int getId()
getId in interface OBasicTransactionpublic void clearRecordEntries()
clearRecordEntries in interface OTransactionpublic void restore()
public int getEntryCount()
getEntryCount in interface OTransactionpublic Collection<ORecordOperation> getCurrentRecordEntries()
getCurrentRecordEntries in interface OTransactionpublic Collection<ORecordOperation> getRecordOperations()
OTransactionInternalgetRecordOperations in interface OTransactiongetRecordOperations in interface OTransactionInternalpublic ORecordOperation getRecordEntry(ORID ridPar)
OTransactionInternalgetRecordEntry in interface OTransactiongetRecordEntry in interface OTransactionInternalridPar - the record id for the change.public ORecord getRecord(ORID rid)
OBasicTransactiongetRecord in interface OBasicTransactionrid - the record RID.null if no record is found, or OBasicTransaction.DELETED_RECORD
if the record was deleted in this transaction.public List<ORecordOperation> getNewRecordEntriesByClass(OClass iClass, boolean iPolymorphic)
getNewRecordEntriesByClass in interface OTransactionpublic List<ORecordOperation> getNewRecordEntriesByClusterIds(int[] iIds)
getNewRecordEntriesByClusterIds in interface OTransactionpublic void clearIndexEntries()
clearIndexEntries in interface OTransactionpublic List<String> getInvolvedIndexes()
getInvolvedIndexes in interface OTransactionpublic ODocument getIndexChanges()
getIndexChanges in interface OTransactionpublic Map<String,OTransactionIndexChanges> getIndexOperations()
OTransactionInternalgetIndexOperations in interface OTransactionInternalpublic OTransactionIndexChanges getIndexChanges(String iIndexName)
getIndexChanges in interface OBasicTransactioniIndexName - the index name.public OTransactionIndexChanges getIndexChangesInternal(String indexName)
OBasicTransactionOBasicTransaction.getIndexChanges(String), but handles remote storages in a
special way.getIndexChangesInternal in interface OBasicTransactionindexName - the index name.null if index is not found or storage is
remote.public void addIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue)
OBasicTransactionaddIndexEntry in interface OBasicTransactiondelegate - the index.iIndexName - the index name.iOperation - the index operation to register.key - the index key.iValue - the index key value.public void addIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue, boolean clientTrackOnly)
public void updateIdentityAfterCommit(ORID oldRid, ORID newRid)
OTransactionInternalupdateIdentityAfterCommit in interface OTransactionupdateIdentityAfterCommit in interface OTransactionInternaloldRid - the id old value.newRid - the id new value.protected void checkTransaction()
protected ODocument serializeIndexChangeEntry(OTransactionIndexChangesPerKey entry, ODocument indexDoc)
public void setCustomData(String iName, Object iValue)
OBasicTransactionsetCustomData in interface OBasicTransactioniName - the value name.iValue - the value to store.public Object getCustomData(String iName)
OBasicTransactiongetCustomData in interface OBasicTransactioniName - the value name.null if no value found.public int getNewObjectCounter()
public void setNoTxLocks(Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks)
public Map<ORID,OTransactionAbstract.LockedRecordMetadata> getNoTxLocks()
public Optional<byte[]> getMetadata()
getMetadata in interface OTransactionInternalpublic void storageBegun()
storageBegun in interface OTransactionInternalpublic void setMetadataHolder(Optional<OTxMetadataHolder> metadata)
setMetadataHolder in interface OTransactionInternalpublic void prepareSerializedOperations()
throws IOException
prepareSerializedOperations in interface OTransactionInternalIOExceptionpublic Iterator<byte[]> getSerializedOperations()
getSerializedOperations in interface OTransactionInternalpublic void resetAllocatedIds()
resetAllocatedIds in interface OTransactionInternalCopyright © 2009–2025 OrientDB. All rights reserved.