如果您查看这个页面:cache.htm
它说:
(可选)将此属性设置为缓存协调模式(org.eclipse.persistence.annotations.CacheCoordinationType枚举类型)。还必须在持久性单元属性中配置缓存协调。参见“缓存”。
我不能为我的一生设置什么属性,因为引用的文档没有提供一个示例。我试过了但有个例外:
<property name="eclipselink.cache.type.coordinationType" value="INVALIDATE_CHANGED_OBJECTS" />
Sep 10 22:57:15 apps-3 run.sh[24742]: java.lang.IllegalArgumentException: Property eclipselink.cache.type.coordinationType has an illegal value INVALIDATE_CHANGED_OBJECTS.
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.sessions.PropertiesHandler$Prop.getValueToApply(PropertiesHandler.java:366)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.sessions.PropertiesHandler$Prop.getPrefixValuesToApply(PropertiesHandler.java:322)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.sessions.PropertiesHandler.getPrefixValuesLogDebug(PropertiesHandler.java:155)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateDescriptorCacheSettings(EntityManagerSetupImpl.java:1424)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateSession(EntityManagerSetupImpl.java:2729)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:713)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:207)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:307)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:318)
Sep 10 22:57:15 apps-3 run.sh[24742]: #011at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:208)有人知道怎么做吗?谢谢!
发布于 2019-08-02 16:35:13
我想我应该给其他人加上一个答案:
我们添加了以下PU属性,缓存工作得很好!我们在Apache TomEE上运行,所以如果您在另一个应用服务器上,下面的openejb:Resource/jms/connectionFactory值会有所不同
<property
name="eclipselink.cache.coordination.protocol"
value="jms" />
<property
name="eclipselink.cache.coordination.jms.topic"
value="openejb:Resource/com.xxx.applications.eclipselink.cache" />
<property
name="eclipselink.cache.coordination.jms.factory"
value="openejb:Resource/jms/connectionFactory" />
<property
name="eclipselink.cache.coordination.jms.reuse-topic-publisher"
value="true" />
<property
name="eclipselink.cache.coordination.remove-connection-on-error"
value="true" />
<property
name="eclipselink.session.name"
value="com.xxx.xxx-jpa-model" />https://stackoverflow.com/questions/52266574
复制相似问题