Eclipselink用于查询的二级缓存,但不适用于分布式/共享缓存

时间:2019-06-07 06:37:24

标签: postgresql eclipselink payara

Eclipselink分布式缓存设置了一个锁。问题众所周知:https://www.eclipse.org/forums/index.php/t/1097290/

下面的代码行过了一会儿阻塞了我的线程。 (下面的代码段是用Eclipselink的依赖项编写的)

public class ConcurrencyManager implements Serializable {
 /**
  * Release the deferred lock.
  * This uses a deadlock detection and resolution algorithm to avoid cache deadlocks.
  * The deferred lock manager keeps track of the lock for a thread, so that other
  * thread know when a deadlock has occurred and can resolve it.
  */
public void releaseDeferredLock() throws ConcurrencyException {
...
while(true)
...
}
}

我想为包含未更改翻译的某些表提供一个只读的,本地(非分布式)二级缓存。

我尝试使用以下属性修改 persistence.xml

   <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
   <validation-mode>CALLBACK</validation-mode>
   <properties>           
     <property name="eclipselink.cache.shared.default" value="true"/>
     <property name="javax.persistence.sharedCache.mode" value="ENABLE_SELECTIVE"/>
     <property name="eclipselink.weaving" value="static" />

我想拥有二级查询缓存,但不共享。如果禁用此缓存,则也会在本地禁用。

0 个答案:

没有答案