/** * INTERNAL: * Check if the object is invalid and *should* be refreshed. * This is used to ensure that no invalid objects are cloned. */ public boolean isConsideredInvalid(Object object, CacheKey cacheKey, ClassDescriptor descriptor) { if (cacheKey.getObject() != null) { CacheInvalidationPolicy cachePolicy = descriptor.getCacheInvalidationPolicy(); // BUG#6671556 refresh invalid objects when accessed in the unit of work. return (cachePolicy.shouldRefreshInvalidObjectsOnClone() && cachePolicy.isInvalidated(cacheKey)); } return false; }
/** * INTERNAL: * Check if the object is invalid and *should* be refreshed. * This is used to ensure that no invalid objects are cloned. */ public boolean isConsideredInvalid(Object object, CacheKey cacheKey, ClassDescriptor descriptor) { if (cacheKey.getObject() != null) { CacheInvalidationPolicy cachePolicy = descriptor.getCacheInvalidationPolicy(); // BUG#6671556 refresh invalid objects when accessed in the unit of work. return (cachePolicy.shouldRefreshInvalidObjectsOnClone() && cachePolicy.isInvalidated(cacheKey)); } return false; }