
public class OTransactionOptimistic extends OTransactionRealAbstract
OTransaction.ISOLATION_LEVEL, OTransaction.TXSTATUS, OTransaction.TXTYPE| Modifier and Type | Field and Description |
|---|---|
protected boolean |
changed |
allEntries, changedDocuments, id, indexEntries, newObjectCounter, recordIndexOperations, updatedRids, userDatadatabase, isolationLevel, locks, statusDELETED_RECORD| Constructor and Description |
|---|
OTransactionOptimistic(ODatabaseDocumentInternal iDatabase) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexEntry(OIndex<?> delegate,
String iIndexName,
OTransactionIndexChanges.OPERATION iOperation,
Object key,
OIdentifiable iValue,
boolean clientTrackOnly)
Bufferizes index changes to be flushed at commit time.
|
ORecordOperation |
addRecord(ORecord iRecord,
byte iStatus,
String iClusterName) |
int |
amountOfNestedTxs() |
void |
begin() |
void |
commit() |
void |
commit(boolean force)
The transaction is reentrant.
|
void |
deleteRecord(ORecord iRecord,
ODatabase.OPERATION_MODE iMode)
Deletes the given record in this transaction.
|
boolean |
getSentToServer() |
void |
internalRollback() |
boolean |
isAlreadyCleared() |
boolean |
isChanged() |
boolean |
isUsingLog()
Retrieve if log is enabled for the transaction
|
ORecord |
loadRecord(ORID rid,
ORecord record,
String fetchPlan,
boolean ignoreCache) |
ORecord |
loadRecord(ORID rid,
ORecord iRecord,
String fetchPlan,
boolean ignoreCache,
boolean iUpdateCache,
boolean loadTombstone,
OStorage.LOCKING_STRATEGY lockingStrategy) |
ORecord |
loadRecord(ORID rid,
ORecord iRecord,
String fetchPlan,
boolean ignoreCache,
boolean loadTombstone,
OStorage.LOCKING_STRATEGY lockingStrategy) |
ORecord |
loadRecordIfVersionIsNotLatest(ORID rid,
int recordVersion,
String fetchPlan,
boolean ignoreCache) |
ORecord |
reloadRecord(ORID rid,
ORecord iRecord,
String fetchPlan,
boolean ignoreCache) |
ORecord |
reloadRecord(ORID rid,
ORecord passedRecord,
String fetchPlan,
boolean ignoreCache,
boolean force) |
void |
resetChangesTracking() |
void |
rollback() |
void |
rollback(boolean force,
int commitLevelDiff) |
ORecord |
saveRecord(ORecord iRecord,
String iClusterName,
ODatabase.OPERATION_MODE iMode,
boolean iForceCreate,
ORecordCallback<? extends Number> iRecordCreatedCallback,
ORecordCallback<Integer> iRecordUpdatedCallback)
Saves the given record in this transaction.
|
void |
setSentToServer(boolean sentToServer) |
void |
setStatus(OTransaction.TXSTATUS iStatus)
Change the status of the transaction.
|
void |
setUsingLog(boolean useLog)
If you set this flag to false, you are unable to
Rollback data changes in case of exception
Restore data in case of server crash
|
String |
toString() |
addChangedDocument, addIndexEntry, checkTransaction, clearIndexEntries, clearRecordEntries, close, getCurrentRecordEntries, getCustomData, getEntryCount, getId, getIndexChanges, getIndexChanges, getIndexChangesInternal, getIndexOperations, getInvolvedIndexes, getNewObjectCounter, getNewRecordEntriesByClass, getNewRecordEntriesByClusterIds, getRecord, getRecordEntry, getRecordOperations, getUpdatedRids, hasRecordCreation, restore, serializeIndexChangeEntry, setCustomData, setDatabase, updateIdentityAfterCommitgetClusterName, getDatabase, getIsolationLevel, getLockedRecords, getStatus, isActive, isLockedRecord, lockingStrategy, lockRecord, setIsolationLevel, unlockRecord, updateCacheFromEntriesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDatabasegetClientTransactionId, isActivepublic OTransactionOptimistic(ODatabaseDocumentInternal iDatabase)
public void begin()
public void commit()
public void commit(boolean force)
begin() has been called several times, the actual commit happens only after the same
amount of commit() callsforce - commit transaction evenpublic int amountOfNestedTxs()
public void rollback()
public void internalRollback()
internalRollback in class OTransactionAbstractpublic void rollback(boolean force,
int commitLevelDiff)
public ORecord loadRecord(ORID rid, ORecord iRecord, String fetchPlan, boolean ignoreCache, boolean loadTombstone, OStorage.LOCKING_STRATEGY lockingStrategy)
public ORecord loadRecord(ORID rid, ORecord iRecord, String fetchPlan, boolean ignoreCache, boolean iUpdateCache, boolean loadTombstone, OStorage.LOCKING_STRATEGY lockingStrategy)
public ORecord loadRecordIfVersionIsNotLatest(ORID rid, int recordVersion, String fetchPlan, boolean ignoreCache) throws ORecordNotFoundException
ORecordNotFoundExceptionpublic ORecord reloadRecord(ORID rid, ORecord iRecord, String fetchPlan, boolean ignoreCache)
public ORecord reloadRecord(ORID rid, ORecord passedRecord, String fetchPlan, boolean ignoreCache, boolean force)
public ORecord loadRecord(ORID rid, ORecord record, String fetchPlan, boolean ignoreCache)
public void deleteRecord(ORecord iRecord, ODatabase.OPERATION_MODE iMode)
OBasicTransactioniRecord - the record to delete.iMode - the operation mode.public ORecord saveRecord(ORecord iRecord, String iClusterName, ODatabase.OPERATION_MODE iMode, boolean iForceCreate, ORecordCallback<? extends Number> iRecordCreatedCallback, ORecordCallback<Integer> iRecordUpdatedCallback)
OBasicTransactioniRecord - the record to save.iClusterName - record's cluster name.iMode - the operation mode.iForceCreate - the force creation flag, true to force the creation of the record, false to allow
updates.iRecordCreatedCallback - the callback to invoke when the record save operation triggered the creation of the record.iRecordUpdatedCallback - the callback to invoke when the record save operation triggered the update of the record.public boolean isUsingLog()
OTransactionInternalpublic void setUsingLog(boolean useLog)
OTransactionSo you practically unable to work in multithreaded environment and keep data consistent.
public void setStatus(OTransaction.TXSTATUS iStatus)
OTransactionInternalpublic ORecordOperation addRecord(ORecord iRecord, byte iStatus, String iClusterName)
public void addIndexEntry(OIndex<?> delegate, String iIndexName, OTransactionIndexChanges.OPERATION iOperation, Object key, OIdentifiable iValue, boolean clientTrackOnly)
OTransactionRealAbstractaddIndexEntry in class OTransactionRealAbstractpublic void resetChangesTracking()
public boolean isChanged()
public boolean isAlreadyCleared()
public void setSentToServer(boolean sentToServer)
public boolean getSentToServer()
Copyright © 2009–2025 OrientDB. All rights reserved.