Eclipse链接共享与受保护的缓存

时间:2021-10-19 03:50:23

The protected cache option allows for shared objects to reference isolated objects. Setting the cache isolation to PROTECTED for an entity enables its shared cache. The protected option is mostly the same as the shared option, except that protected entities can have relationships to isolated entities, where as shared can not.

受保护的缓存选项允许共享对象引用隔离的对象。为实体设置缓存隔离为PROTECTED可启用其共享缓存。受保护的选项与共享选项大致相同,只是受保护的实体可以与隔离的实体有关系,而共享则不能。

what is the meaning of this exception. does this make the isolated entity shared if they have relationship with protected entity

这个例外是什么意思。如果它们与受保护实体有关系,这会使隔离实体共享吗?

2 个解决方案

#1


Protected option can be used to ensure read-only entities and queries always copy the cached objects. So you can simulate a data cache with EclipseLink. while shared ready-only will not be copied.

受保护的选项可用于确保只读实体和查询始终复制缓存的对象。因此,您可以使用EclipseLink模拟数据缓存。虽然不会复制共享就绪。

#2


An isolated entity is isolated, so it can never be in the shared cache. Protected vs shared only affect the entity it is applied to, and what references it is allowed to keep. References to isolated entities require special handling (and overhead) so that the isolated entities don't end up in the shared cache, hence shared entities allowing references to isolated entities were given a special designation.

隔离的实体是隔离的,因此它永远不会位于共享缓存中。受保护与共享仅影响它应用于的实体,以及允许保留的引用。对隔离实体的引用需要特殊处理(和开销),以便隔离的实体不会在共享高速缓存中结束,因此允许对隔离实体的引用的共享实体被赋予特殊名称。

#1


Protected option can be used to ensure read-only entities and queries always copy the cached objects. So you can simulate a data cache with EclipseLink. while shared ready-only will not be copied.

受保护的选项可用于确保只读实体和查询始终复制缓存的对象。因此,您可以使用EclipseLink模拟数据缓存。虽然不会复制共享就绪。

#2


An isolated entity is isolated, so it can never be in the shared cache. Protected vs shared only affect the entity it is applied to, and what references it is allowed to keep. References to isolated entities require special handling (and overhead) so that the isolated entities don't end up in the shared cache, hence shared entities allowing references to isolated entities were given a special designation.

隔离的实体是隔离的,因此它永远不会位于共享缓存中。受保护与共享仅影响它应用于的实体,以及允许保留的引用。对隔离实体的引用需要特殊处理(和开销),以便隔离的实体不会在共享高速缓存中结束,因此允许对隔离实体的引用的共享实体被赋予特殊名称。