public class OTransactionNoTx extends OTransactionAbstract
OTransactionAbstract.LockedRecordMetadata
OTransaction.ISOLATION_LEVEL, OTransaction.TXSTATUS, OTransaction.TXTYPE
database, isolationLevel, locks, status
DELETED_RECORD
Constructor and Description |
---|
OTransactionNoTx(ODatabaseDocumentInternal iDatabase,
Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks) |
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 indexName,
OTransactionIndexChanges.OPERATION status,
Object key,
OIdentifiable value)
Adds the transactional index entry in this transaction.
|
int |
amountOfNestedTxs() |
void |
begin() |
void |
clearIndexEntries() |
void |
clearRecordEntries() |
void |
commit() |
void |
commit(boolean force) |
void |
deleteRecord(ORecord iRecord,
ODatabase.OPERATION_MODE iMode)
Deletes the record.
|
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 iName)
Obtains the index changes done in the context of this transaction.
|
OTransactionIndexChanges |
getIndexChangesInternal(String indexName)
Does the same thing as
OBasicTransaction.getIndexChanges(String) , but handles remote storages in a
special way. |
List<String> |
getInvolvedIndexes() |
List<ORecordOperation> |
getNewRecordEntriesByClass(OClass iClass,
boolean iPolymorphic) |
List<ORecordOperation> |
getNewRecordEntriesByClusterIds(int[] iIds) |
ORecord |
getRecord(ORID rid)
Resolves a record with the given RID in the context of this transaction.
|
int |
getRecordEntriesSize() |
ORecordOperation |
getRecordEntry(ORID rid) |
Collection<ORecordOperation> |
getRecordOperations() |
void |
internalRollback() |
boolean |
isUsingLog() |
ORecord |
loadRecord(ORID iRid,
ORecord iRecord,
String iFetchPlan,
boolean ignoreCache) |
ORecord |
loadRecord(ORID iRid,
ORecord iRecord,
String iFetchPlan,
boolean ignoreCache,
boolean iUpdateCache,
boolean loadTombstone,
OStorage.LOCKING_STRATEGY iLockingStrategy)
Deprecated.
|
ORecord |
loadRecord(ORID iRid,
ORecord iRecord,
String iFetchPlan,
boolean ignoreCache,
boolean loadTombstone,
OStorage.LOCKING_STRATEGY iLockingStrategy)
Deprecated.
|
ORecord |
loadRecordIfVersionIsNotLatest(ORID rid,
int recordVersion,
String fetchPlan,
boolean ignoreCache) |
ORecord |
reloadRecord(ORID rid,
ORecord record,
String fetchPlan,
boolean ignoreCache) |
ORecord |
reloadRecord(ORID rid,
ORecord record,
String fetchPlan,
boolean ignoreCache,
boolean force) |
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)
Update the record.
|
void |
setCustomData(String iName,
Object iValue)
Sets the custom value by its name stored in the context of this transaction.
|
OTransaction |
setIsolationLevel(OTransaction.ISOLATION_LEVEL isolationLevel)
Changes the isolation level.
|
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
|
void |
updateIdentityAfterCommit(ORID oldRid,
ORID newRid)
When commit in transaction is performed all new records will change their identity, but index
values will contain stale links, to fix them given method will be called for each entry.
|
close, getDatabase, getInternalLocks, getIsolationLevel, getLockedRecords, getStatus, isActive, isLockedRecord, lockingStrategy, lockRecord, setDatabase, setLocks, trackLockedRecord, trackUnlockRecord, unlockRecord, updateCacheFromEntries
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getClientTransactionId
public OTransactionNoTx(ODatabaseDocumentInternal iDatabase, Map<ORID,OTransactionAbstract.LockedRecordMetadata> noTxLocks)
public void begin()
public void commit()
public int getEntryCount()
public void commit(boolean force)
public void rollback()
@Deprecated public ORecord loadRecord(ORID iRid, ORecord iRecord, String iFetchPlan, boolean ignoreCache, boolean loadTombstone, OStorage.LOCKING_STRATEGY iLockingStrategy)
@Deprecated public ORecord loadRecord(ORID iRid, ORecord iRecord, String iFetchPlan, boolean ignoreCache, boolean iUpdateCache, boolean loadTombstone, OStorage.LOCKING_STRATEGY iLockingStrategy)
public ORecord loadRecord(ORID iRid, ORecord iRecord, String iFetchPlan, boolean ignoreCache)
public ORecord reloadRecord(ORID rid, ORecord record, String fetchPlan, boolean ignoreCache)
public ORecord reloadRecord(ORID rid, ORecord record, String fetchPlan, boolean ignoreCache, boolean force)
public ORecord loadRecordIfVersionIsNotLatest(ORID rid, int recordVersion, String fetchPlan, boolean ignoreCache) throws ORecordNotFoundException
ORecordNotFoundException
public ORecord saveRecord(ORecord iRecord, String iClusterName, ODatabase.OPERATION_MODE iMode, boolean iForceCreate, ORecordCallback<? extends Number> iRecordCreatedCallback, ORecordCallback<Integer> iRecordUpdatedCallback)
iRecord
- iForceCreate
- iRecordCreatedCallback
- iRecordUpdatedCallback
- iClusterName
- record's cluster name.iMode
- the operation mode.public OTransaction setIsolationLevel(OTransaction.ISOLATION_LEVEL isolationLevel)
OTransaction
setIsolationLevel
in interface OTransaction
setIsolationLevel
in class OTransactionAbstract
isolationLevel
- Isolation level to setpublic void deleteRecord(ORecord iRecord, ODatabase.OPERATION_MODE iMode)
iRecord
- the record to delete.iMode
- the operation mode.public Collection<ORecordOperation> getCurrentRecordEntries()
public Collection<ORecordOperation> getRecordOperations()
public List<ORecordOperation> getNewRecordEntriesByClass(OClass iClass, boolean iPolymorphic)
public List<ORecordOperation> getNewRecordEntriesByClusterIds(int[] iIds)
public void clearRecordEntries()
public int getRecordEntriesSize()
public ORecord getRecord(ORID rid)
OBasicTransaction
rid
- the record RID.null
if no record is found, or OBasicTransaction.DELETED_RECORD
if the record was deleted in this transaction.public ORecordOperation getRecordEntry(ORID rid)
public boolean isUsingLog()
public void setCustomData(String iName, Object iValue)
OBasicTransaction
iName
- the value name.iValue
- the value to store.public Object getCustomData(String iName)
OBasicTransaction
iName
- the value name.null
if no value found.public void setUsingLog(boolean useLog)
OTransaction
So you practically unable to work in multithreaded environment and keep data consistent.
public ODocument getIndexChanges()
public void addIndexEntry(OIndex delegate, String indexName, OTransactionIndexChanges.OPERATION status, Object key, OIdentifiable value)
OBasicTransaction
delegate
- the index.indexName
- the index name.status
- the index operation to register.key
- the index key.value
- the index key value.public void addChangedDocument(ODocument document)
OBasicTransaction
document
- the document to add.public void clearIndexEntries()
public OTransactionIndexChanges getIndexChanges(String iName)
OBasicTransaction
iName
- the index name.null
if index is not found.public int getId()
public void updateIdentityAfterCommit(ORID oldRid, ORID newRid)
OTransaction
oldRid
- Record identity before commit.newRid
- Record identity after commit.public int amountOfNestedTxs()
public void rollback(boolean force, int commitLevelDiff)
public OTransactionIndexChanges getIndexChangesInternal(String indexName)
OBasicTransaction
OBasicTransaction.getIndexChanges(String)
, but handles remote storages in a
special way.indexName
- the index name.null
if index is not found or storage is
remote.public void internalRollback()
internalRollback
in class OTransactionAbstract
Copyright © 2009–2020 OrientDB. All rights reserved.