我希望能够通过 jboss-cli 启用或禁用 eclipselink 共享缓存(二级缓存)。
我们通常shared-cache-mode
设置为DISABLE_SELECTIVE
,但在某些部署中,我们希望能够禁用它。如果我们可以通过 jboss-cli 做到这一点并且避免编辑我们的 persistence.xml,那就太好了。
任何人有任何想法或经验做类似的事情?
我在下面包含了我们的 persistence.xml。我很乐意提供任何其他可能有用的东西。
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="AppPu">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>app.datasource</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="eclipselink.persistence-context.flush-mode" value="commit" />
<property name="eclipselink.jdbc.batch-writing" value="jdbc" />
<property name="eclipselink.jdbc.batch-writing.size" value="500"/>
<property name="eclipselink.session-event-listener" value="com.demo.app.common.eclipselink.GeometryInitializer"/>
<property name="eclipselink.logging.logger" value="DefaultLogger"/>
<property name="eclipselink.logging.file" value="sqldump.log"/>
<property name="eclipselink.logging.parameters" value="true"/>
</properties>
</persistence-unit>
</persistence>