我试图在Wildfly 15+中为我的会话缓存使用jdbc-store类型。
我运行以下命令来配置我的standalone-full-ha.xml配置文件:
/subsystem=infinispan/cache-container=web/invalidation-cache=jdbc/:add(mode=SYNC)
/subsystem=infinispan/cache-container=web/invalidation-cache=jdbc/store=none:remove(){allow-resource-service-restart=true}
/subsystem=infinispan/cache-container=web/invalidation-cache=jdbc/store=jdbc/:add(data-source="...",passivation=false,shared=true){allow-resource-service-restart=true}
/subsystem=infinispan/cache-container=web/invalidation-cache=jdbc/component=transaction/:add()
/subsystem=infinispan/cache-container=web/invalidation-cache=jdbc/component=transaction/:write-attribute(name=mode,value=BATCH)
/subsystem=infinispan/cache-container=web:write-attribute(name=default-cache,value=jdbc)..。这将在配置文件中生成以下内容:
<cache-container name="web" default-cache="jdbc" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<invalidation-cache name="jdbc">
<transaction mode="BATCH"/>
<jdbc-store data-source="..." passivation="false" shared="true">
<table/>
</jdbc-store>
</invalidation-cache>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
</cache-container>看起来我已经使用JBoss CLI正确地配置了缓存,但是当集群实例启动时,即使一切正常启动,也不会在数据库中创建会话存储表。
我的问题是,是否应该在<table/>元素中设置一些我只是忽略的东西?查看documentation,我没有看到任何必需的属性,也没有看到任何关于自动创建的东西。
我已经研究了在Wildfly 11中如何实现这一点的以前的examples,但是string-keyed-jdbc-store元素似乎不再有效。我知道Infinispan的documentation提到了string-keyed-table元素的create-on-start属性,但这种配置在Wildfly中差别太大,完全没有帮助。
发布于 2019-09-06 23:32:32
添加
<property name="createTableOnStart">
true
</property>在jdbc-store元素中,并确保web.xml为<distributable />
https://stackoverflow.com/questions/55881179
复制相似问题