Class OTransactionOptimisticServer
java.lang.Object
com.orientechnologies.orient.core.tx.OTransactionAbstract
com.orientechnologies.orient.core.tx.OTransactionOptimistic
com.orientechnologies.orient.server.tx.OTransactionOptimisticServer
- All Implemented Interfaces:
OAllocationTransaction,OStorageTransaction,OTransaction,OTransactionInternal
Created by tglman on 28/12/16.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.orientechnologies.orient.core.tx.OTransactionAbstract
OTransactionAbstract.LockedRecordMetadataNested classes/interfaces inherited from interface com.orientechnologies.orient.core.tx.OTransaction
OTransaction.ISOLATION_LEVEL, OTransaction.TXSTATUS, OTransaction.TXTYPE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final List<IndexChange>protected Map<ORID,ORecordOperation> protected List<ORecordOperationRequest>protected final Map<ORID,ORecordOperation> Fields inherited from class com.orientechnologies.orient.core.tx.OTransactionOptimistic
allEntries, changed, changedDocuments, id, indexEntries, newObjectCounter, recordIndexOperations, updatedRids, userDataFields inherited from class com.orientechnologies.orient.core.tx.OTransactionAbstract
database, DELETED_RECORD, isolationLevel, locks, status -
Constructor Summary
ConstructorsConstructorDescriptionOTransactionOptimisticServer(ODatabaseDocumentInternal database, int txId, List<ORecordOperationRequest> operations, List<IndexChange> indexChanges) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue) Adds the transactional index entry in this transaction.voidaddIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue, boolean clientTrackOnly) Bufferizes index changes to be flushed at commit time.voidvoidvoidbegin()protected OCompositeKeyintResolves a record with the given RID in the context of this transaction.protected voidunmarshallRecord(ORecord iRecord) Unmarshalls collections.Methods inherited from class com.orientechnologies.orient.core.tx.OTransactionOptimistic
addChangedDocument, amountOfNestedTxs, checkTransactionValid, close, commit, commit, commitPreallocate, deleteRecord, fill, getChangesForIndex, getCustomData, getEntryCount, getId, getIndexChanges, getIndexChanges, getIndexChangesInternal, getIndexOperations, getInvolvedIndexes, getLockedRecords, getMetadata, getNewObjectCounter, getNewRecordEntriesByClass, getNewRecordEntriesByClusterIds, getNoTxLocks, getRecordChanges, getRecordEntry, getRecordOperations, getSentToServer, getSerializedOperations, getTxStartCounter, getUpdatedRids, internalRollback, isAlreadyCleared, isChanged, loadRecord, loadRecord, loadRecordIfVersionIsNotLatest, prepareSerializedOperations, reloadRecord, reloadRecord, resetAllocatedIds, resetChangesTracking, resolveTracking, rollback, rollback, saveRecord, serializeIndexChangeEntry, setCustomData, setMetadataHolder, setNoTxLocks, setSentToServer, setStatus, startedStorageTransaction, toString, updateCache, updateIdentityAfterCommitMethods inherited from class com.orientechnologies.orient.core.tx.OTransactionAbstract
getDatabase, getInternalLocks, getIsolationLevel, getStatus, isActive, isLockedRecord, lockingStrategy, lockRecord, newOp, setDatabase, setIsolationLevel, setLocks, trackLockedRecord, trackUnlockRecord, unlockRecord, updateCacheFromEntriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.tx.OTransaction
getIsolationLevel, getStatus, isActive, isLockedRecord, lockingStrategy, lockRecord, setIsolationLevel, unlockRecordMethods inherited from interface com.orientechnologies.orient.core.tx.OTransactionInternal
getDatabase, isSequenceTransaction, setDatabase
-
Field Details
-
tempEntries
-
createdRecords
-
updatedRecords
-
deletedRecord
-
clientTxId
protected final int clientTxId -
indexChanges
-
oldTxEntries
-
operations
-
-
Constructor Details
-
OTransactionOptimisticServer
public OTransactionOptimisticServer(ODatabaseDocumentInternal database, int txId, List<ORecordOperationRequest> operations, List<IndexChange> indexChanges)
-
-
Method Details
-
begin
public void begin()- Specified by:
beginin interfaceOTransaction- Overrides:
beginin classOTransactionOptimistic
-
getClientTransactionId
public int getClientTransactionId()- Returns:
- this transaction ID as seen by the client of this transaction.
-
checkCompositeKeyId
-
getRecord
Description copied from interface:OTransactionResolves a record with the given RID in the context of this transaction.- Specified by:
getRecordin interfaceOTransaction- Overrides:
getRecordin classOTransactionOptimistic- Parameters:
rid- the record RID.- Returns:
- the resolved record, or
nullif no record is found, orOTransactionAbstract.DELETED_RECORDif the record was deleted in this transaction.
-
getCreatedRecords
-
getUpdatedRecords
-
getDeletedRecord
-
unmarshallRecord
Unmarshalls collections. This prevent temporary RIDs remains stored as are. -
addRecord
- Overrides:
addRecordin classOTransactionOptimistic
-
addRecord
public void addRecord(ORecord iRecord, byte iStatus, String iClusterName, Map<ORID, ORecordOperation> oldTx) -
assignClusters
public void assignClusters() -
addIndexEntry
public void addIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue) Description copied from interface:OTransactionAdds the transactional index entry in this transaction.- Specified by:
addIndexEntryin interfaceOTransaction- Overrides:
addIndexEntryin classOTransactionOptimistic- Parameters:
delegate- the index.iIndexName- the index name.iOperation- the index operation to register.key- the index key.iValue- the index key value.
-
addIndexEntry
public void addIndexEntry(OIndex delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue, boolean clientTrackOnly) Description copied from class:OTransactionOptimisticBufferizes index changes to be flushed at commit time.- Overrides:
addIndexEntryin classOTransactionOptimistic
-