/** * {@inheritDoc} */ public <RET extends ORecord> RET load(final ORID iRecordId, final String iFetchPlan, final boolean iIgnoreCache) { return (RET) executeReadRecord((ORecordId) iRecordId, null, -1, iFetchPlan, iIgnoreCache, !iIgnoreCache, false, OStorage.LOCKING_STRATEGY.DEFAULT, new SimpleRecordReader(prefetchRecords)); }
/** * {@inheritDoc} */ public <RET extends ORecord> RET load(final ORecord iRecord, final String iFetchPlan, final boolean iIgnoreCache) { return (RET) executeReadRecord((ORecordId) iRecord.getIdentity(), iRecord, -1, iFetchPlan, iIgnoreCache, !iIgnoreCache, false, OStorage.LOCKING_STRATEGY.NONE, new SimpleRecordReader(prefetchRecords)); }
@Deprecated public ORecord loadRecord(final ORID iRid, final ORecord iRecord, final String iFetchPlan, final boolean ignoreCache, final boolean loadTombstone, final OStorage.LOCKING_STRATEGY iLockingStrategy) { if (iRid.isNew()) return null; return database .executeReadRecord((ORecordId) iRid, iRecord, -1, iFetchPlan, ignoreCache, !ignoreCache, loadTombstone, iLockingStrategy, new SimpleRecordReader(database.isPrefetchRecords())); }
@Deprecated public ORecord loadRecord(final ORID iRid, final ORecord iRecord, final String iFetchPlan, final boolean ignoreCache, final boolean iUpdateCache, final boolean loadTombstone, final OStorage.LOCKING_STRATEGY iLockingStrategy) { if (iRid.isNew()) return null; return database .executeReadRecord((ORecordId) iRid, iRecord, -1, iFetchPlan, ignoreCache, iUpdateCache, loadTombstone, iLockingStrategy, new SimpleRecordReader(database.isPrefetchRecords())); }
public ORecord loadRecord(final ORID iRid, final ORecord iRecord, final String iFetchPlan, final boolean ignoreCache) { if (iRid.isNew()) return null; return database.executeReadRecord((ORecordId) iRid, iRecord, -1, iFetchPlan, ignoreCache, !ignoreCache, false, OStorage.LOCKING_STRATEGY.NONE, new SimpleRecordReader(database.isPrefetchRecords())); }
/** * Should be used only by console commands */ public void reloadRecordInternal(String iRecordId, String iFetchPlan) { checkForDatabase(); currentRecord = currentDatabase .executeReadRecord(new ORecordId(iRecordId), null, -1, iFetchPlan, true, false, false, OStorage.LOCKING_STRATEGY.NONE, new SimpleRecordReader(false)); displayRecord(null); message("\nOK"); }
@Override public ORecord reloadRecord(ORID rid, ORecord record, String fetchPlan, boolean ignoreCache, boolean force) { if (rid.isNew()) return null; final RecordReader recordReader; if (force) { recordReader = new SimpleRecordReader(database.isPrefetchRecords()); } else { recordReader = new LatestVersionRecordReader(); } final ORecord loadedRecord = database .executeReadRecord((ORecordId) rid, record, -1, fetchPlan, ignoreCache, !ignoreCache, false, OStorage.LOCKING_STRATEGY.NONE, recordReader); if (force) { return loadedRecord; } else { if (loadedRecord == null) return record; return loadedRecord; } }
@Override public ORecord loadRecordIfVersionIsNotLatest(ORID rid, final int recordVersion, String fetchPlan, boolean ignoreCache) throws ORecordNotFoundException { checkTransaction(); final ORecord txRecord = getRecord(rid); if (txRecord == OBasicTransaction.DELETED_RECORD) // DELETED IN TX throw new ORecordNotFoundException(rid); if (txRecord != null) { if (txRecord.getVersion() > recordVersion) return txRecord; else return null; } if (rid.isTemporary()) throw new ORecordNotFoundException(rid); // DELEGATE TO THE STORAGE, NO TOMBSTONES SUPPORT IN TX MODE final ORecord record = database .executeReadRecord((ORecordId) rid, null, recordVersion, fetchPlan, ignoreCache, !ignoreCache, false, OStorage.LOCKING_STRATEGY.NONE, new SimpleRecordReader(database.isPrefetchRecords())); if (record != null && isolationLevel == ISOLATION_LEVEL.REPEATABLE_READ) // KEEP THE RECORD IN TX TO ASSURE REPEATABLE READS addRecord(record, ORecordOperation.LOADED, null); return record; }
public ORecord loadRecord(final ORID rid, final ORecord iRecord, final String fetchPlan, final boolean ignoreCache, final boolean iUpdateCache, final boolean loadTombstone, final OStorage.LOCKING_STRATEGY lockingStrategy) { checkTransaction(); final ORecord txRecord = getRecord(rid); if (txRecord == OBasicTransaction.DELETED_RECORD) // DELETED IN TX return null; if (txRecord != null) { if (iRecord != null && txRecord != iRecord) OLogManager.instance().warn(this, "Found record in transaction with the same RID %s but different instance. " + "Probably the record has been loaded from another transaction and reused on the current one: reload it " + "from current transaction before to update or delete it", iRecord.getIdentity()); return txRecord; } if (rid.isTemporary()) return null; // DELEGATE TO THE STORAGE, NO TOMBSTONES SUPPORT IN TX MODE final ORecord record = database .executeReadRecord((ORecordId) rid, iRecord, -1, fetchPlan, ignoreCache, iUpdateCache, loadTombstone, lockingStrategy, new SimpleRecordReader(database.isPrefetchRecords())); if (record != null && isolationLevel == ISOLATION_LEVEL.REPEATABLE_READ) // KEEP THE RECORD IN TX TO ASSURE REPEATABLE READS addRecord(record, ORecordOperation.LOADED, null); return record; }
final RecordReader recordReader; if (force) { recordReader = new SimpleRecordReader(database.isPrefetchRecords()); } else { recordReader = new LatestVersionRecordReader();