public abstract class OTransactionRealAbstract extends OTransactionAbstract implements OTransactionInternal
OTransactionAbstract.LockedRecordMetadata
OTransaction.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, status
DELETED_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 rid)
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 |
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, updateCacheFromEntries
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fill, getDatabase, getLockedRecords, isSequenceTransaction, isUsingLog, setDatabase, setStatus
deleteRecord, getClientTransactionId, isActive, saveRecord
amountOfNestedTxs, begin, commit, commit, isUsingLog, loadRecord, loadRecord, loadRecord, loadRecordIfVersionIsNotLatest, reloadRecord, reloadRecord, rollback, rollback, setUsingLog
protected 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)
OBasicTransaction
addChangedDocument
in interface OBasicTransaction
document
- the document to add.public void close()
OTransactionAbstract
close
in interface OTransaction
close
in class OTransactionAbstract
public int getId()
getId
in interface OBasicTransaction
public void clearRecordEntries()
clearRecordEntries
in interface OTransaction
public void restore()
public int getEntryCount()
getEntryCount
in interface OTransaction
public Collection<ORecordOperation> getCurrentRecordEntries()
getCurrentRecordEntries
in interface OTransaction
public Collection<ORecordOperation> getRecordOperations()
OTransactionInternal
getRecordOperations
in interface OTransaction
getRecordOperations
in interface OTransactionInternal
public ORecordOperation getRecordEntry(ORID rid)
OTransactionInternal
getRecordEntry
in interface OTransaction
getRecordEntry
in interface OTransactionInternal
rid
- the record id for the change.public ORecord getRecord(ORID rid)
OBasicTransaction
getRecord
in interface OBasicTransaction
rid
- 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 OTransaction
public List<ORecordOperation> getNewRecordEntriesByClusterIds(int[] iIds)
getNewRecordEntriesByClusterIds
in interface OTransaction
public void clearIndexEntries()
clearIndexEntries
in interface OTransaction
public List<String> getInvolvedIndexes()
getInvolvedIndexes
in interface OTransaction
public ODocument getIndexChanges()
getIndexChanges
in interface OTransaction
public Map<String,OTransactionIndexChanges> getIndexOperations()
OTransactionInternal
getIndexOperations
in interface OTransactionInternal
public OTransactionIndexChanges getIndexChanges(String iIndexName)
getIndexChanges
in interface OBasicTransaction
iIndexName
- the index name.public OTransactionIndexChanges getIndexChangesInternal(String indexName)
OBasicTransaction
OBasicTransaction.getIndexChanges(String)
, but handles remote storages in a
special way.getIndexChangesInternal
in interface OBasicTransaction
indexName
- 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)
OBasicTransaction
addIndexEntry
in interface OBasicTransaction
delegate
- 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)
OTransactionInternal
updateIdentityAfterCommit
in interface OTransaction
updateIdentityAfterCommit
in interface OTransactionInternal
oldRid
- 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)
OBasicTransaction
setCustomData
in interface OBasicTransaction
iName
- the value name.iValue
- the value to store.public Object getCustomData(String iName)
OBasicTransaction
getCustomData
in interface OBasicTransaction
iName
- 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 OTransactionInternal
public void storageBegun()
storageBegun
in interface OTransactionInternal
public void setMetadataHolder(Optional<OTxMetadataHolder> metadata)
setMetadataHolder
in interface OTransactionInternal
public void prepareSerializedOperations() throws IOException
prepareSerializedOperations
in interface OTransactionInternal
IOException
public Iterator<byte[]> getSerializedOperations()
getSerializedOperations
in interface OTransactionInternal
Copyright © 2009–2020 OrientDB. All rights reserved.