/** * Initialize a cache key. Called by buildObject and now also by * buildWorkingCopyCloneFromRow. */ protected void copyQueryInfoToCacheKey(CacheKey cacheKey, ObjectBuildingQuery query, AbstractRecord databaseRow, AbstractSession session, ClassDescriptor concreteDescriptor) { //CR #4365 - used to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); Object cacheValue = policy.getValueToPutInCache(databaseRow, session); //register the object into the IM and set the write lock object cacheKey.setWriteLockValue(cacheValue); } cacheKey.setReadTime(query.getExecutionTime()); }
/** * Initialize a cache key. Called by buildObject and now also by * buildWorkingCopyCloneFromRow. */ protected void copyQueryInfoToCacheKey(CacheKey cacheKey, ObjectBuildingQuery query, AbstractRecord databaseRow, AbstractSession session, ClassDescriptor concreteDescriptor) { //CR #4365 - used to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); Object cacheValue = policy.getValueToPutInCache(databaseRow, session); //register the object into the IM and set the write lock object cacheKey.setWriteLockValue(cacheValue); } cacheKey.setReadTime(query.getExecutionTime()); }
/** * Initialize a cache key. Called by buildObject and now also by * buildWorkingCopyCloneFromRow. */ protected void copyQueryInfoToCacheKey(CacheKey cacheKey, ObjectBuildingQuery query, AbstractRecord databaseRow, AbstractSession session, ClassDescriptor concreteDescriptor) { //CR #4365 - used to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); Object cacheValue = policy.getValueToPutInCache(databaseRow, session); //register the object into the IM and set the write lock object cacheKey.setWriteLockValue(cacheValue); } cacheKey.setReadTime(query.getExecutionTime()); }
nestedQuery.setQueryId(joinManager.getBaseQuery().getQueryId()); nestedQuery.setExecutionTime(joinManager.getBaseQuery().getExecutionTime()); joinManager.getJoinedMappingQueryClones().put(this, nestedQuery);
nestedQuery.setQueryId(joinManager.getBaseQuery().getQueryId()); nestedQuery.setExecutionTime(joinManager.getBaseQuery().getExecutionTime()); joinManager.getJoinedMappingQueryClones().put(this, nestedQuery);
nestedQuery.setQueryId(joinManager.getBaseQuery().getQueryId()); nestedQuery.setExecutionTime(joinManager.getBaseQuery().getExecutionTime()); joinManager.getJoinedMappingQueryClones().put(this, nestedQuery);
targetQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); targetQuery.setQueryId(sourceQuery.getQueryId());
targetQuery.setCascadePolicy(query.getCascadePolicy()); targetQuery.setQueryId(query.getQueryId());
targetQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); targetQuery.setQueryId(sourceQuery.getQueryId());
targetQuery.setCascadePolicy(query.getCascadePolicy()); targetQuery.setQueryId(query.getQueryId());
targetQuery.setCascadePolicy(query.getCascadePolicy()); targetQuery.setQueryId(query.getQueryId());
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session, boolean targetIsProtected) { FetchGroup fetchGroup = query.getExecutionFetchGroup(concreteDescriptor); FetchGroupManager fetchGroupManager = concreteDescriptor.getFetchGroupManager(); //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. fetchGroupManager.reset(domainObject); //set fetch group reference to the cached object fetchGroupManager.setObjectFetchGroup(domainObject, fetchGroupManager.getEntityFetchGroup(fetchGroup), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, cacheKey, databaseRow, query, joinManager, fetchGroup, false, session); //set refresh on fetch group fetchGroupManager.setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session, boolean targetIsProtected) { FetchGroup fetchGroup = query.getExecutionFetchGroup(concreteDescriptor); FetchGroupManager fetchGroupManager = concreteDescriptor.getFetchGroupManager(); //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. fetchGroupManager.reset(domainObject); //set fetch group reference to the cached object fetchGroupManager.setObjectFetchGroup(domainObject, fetchGroupManager.getEntityFetchGroup(fetchGroup), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, cacheKey, databaseRow, query, joinManager, fetchGroup, false, session); //set refresh on fetch group fetchGroupManager.setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session) { //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. concreteDescriptor.getFetchGroupManager().reset(domainObject); //set fetch group reference to the cached object concreteDescriptor.getFetchGroupManager().setObjectFetchGroup(domainObject, query.getFetchGroup(), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, databaseRow, query, joinManager, false); //set refresh on fetch group concreteDescriptor.getFetchGroupManager().setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }
query.setQueryId(sourceQuery.getQueryId());
cacheHit = false; cacheKey.setLastUpdatedQueryId(query.getQueryId());
cacheHit = false; cacheKey.setLastUpdatedQueryId(query.getQueryId());
targetQuery.setQueryId(sourceQuery.getQueryId());
query.setQueryId(sourceQuery.getQueryId());
query.setQueryId(sourceQuery.getQueryId());