首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用无效缓存和jdbc存储不能使用Wildfly 15+自动创建Infinispan缓存表

使用无效缓存和jdbc存储不能使用Wildfly 15+自动创建Infinispan缓存表
EN

Stack Overflow用户
提问于 2019-04-27 21:45:09
回答 1查看 348关注 0票数 0

我试图在Wildfly 15+中为我的会话缓存使用jdbc-store类型。

我运行以下命令来配置我的standalone-full-ha.xml配置文件:

代码语言:javascript
复制
/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)

..。这将在配置文件中生成以下内容:

代码语言:javascript
复制
<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中差别太大,完全没有帮助。

EN

回答 1

Stack Overflow用户

发布于 2019-09-06 23:32:32

添加

代码语言:javascript
复制
<property name="createTableOnStart">
    true
</property>

jdbc-store元素中,并确保web.xml为<distributable />

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55881179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档