【问题标题】:ibatis - cannot set cacheModelibatis - 无法设置cacheModel
【发布时间】:2010-07-16 13:58:26
【问题描述】:

我想在插入时设置 cacheModel,我这样做:

<select id="SelectAll_Cache" resultClass="SN" cacheModel="cache-select-all">
    <include refid="GetAll_SN"/>
</select>

<cacheModel id="cache-select-all" implementation="LRU" readOnly="false" serialize="true">
    <flushInterval hours="24"/>
    <property name="size" value="800"/>
</cacheModel>

如果我执行查询,我会得到以下异常:

  • 将 CacheModel 设置为语句时发生错误。
  • 声明:SelectAll_Cache
  • cacheModel 出现错误:SN.cache-select-all。

【问题讨论】:

  • 问题已解决:必须有一个 标签和里面的所有 标签
  • 如果您找到了答案,请将其发布为 aswer 并接受它。

标签: ibatis ibatis.net


【解决方案1】:

在使用之前指定缓存模型。

您应该先在您的 sql map 中定义缓存模型,然后再在 select 语句中使用它;然后只有 ibatis sql map 解析器应该能够找到您在语句中使用的缓存模型。

【讨论】:

    猜你喜欢
    • 2011-03-16
    • 1970-01-01
    • 1970-01-01
    • 2012-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-03
    相关资源
    最近更新 更多