ibatis 3 的缓存问题

NOKIA5320XM 2010-01-07 04:54:29
我做一个查询操作,我每刷新一下,它就从数据库中取一次。不知哪里错了?
代码如下:

<mapper namespace="HelpTopicSpace">
<select id="findHelpTopicAll" resultType="org.apache.ibatis.zsamples.entities.HelpTopic" useCache="true">
select help_topic_id as id,
name as name,
help_category_id,
description as description,
example as example,
url as url from help_topic ;
</select>
</mapper>

...全文
204 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
kaqike 2010-04-12
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 nokia5320xm 的回复:]
引用 9 楼 warison2008 的回复:
cacheModelsEnabled="true" 设置没有?

ibatis 3 没有这个玩意。
[/Quote]
3里面这样写
<settings>
<setting name="cacheModelsEnabled" value="true"/>
</settings>
villagehead 2010-01-08
  • 打赏
  • 举报
回复
zd
xx
bd

good luck
NOKIA5320XM 2010-01-08
  • 打赏
  • 举报
回复

谁能告诉我啊~~~~~~~~~~~。
道光2008 2010-01-08
  • 打赏
  • 举报
回复
那改成2嘛
NOKIA5320XM 2010-01-08
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 warison2008 的回复:]
cacheModelsEnabled="true" 设置没有?
[/Quote]
ibatis 3 没有这个玩意。
crazylaa 2010-01-08
  • 打赏
  • 举报
回复
你是菜鸟我怕你。
我不懂我帮顶
道光2008 2010-01-08
  • 打赏
  • 举报
回复
cacheModelsEnabled="true" 设置没有?
liguangwen86 2010-01-07
  • 打赏
  • 举报
回复
帮顶
NOKIA5320XM 2010-01-07
  • 打赏
  • 举报
回复

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="HelpTopicSpace">
<select id="findHelpTopicAll" resultType="org.apache.ibatis.zsamples.entities.HelpTopic" useCache="true">
select help_topic_id as id,
name as name,
help_category_id,
description as description,
example as example,
url as url from help_topic ;
</select>
<cache eviction="FIFO" flushInterval="600" readOnly="true" size="512">
</cache>

</mapper>
mengxq 2010-01-07
  • 打赏
  • 举报
回复
IBATIS缓存机制配置,例如:
<settings
cacheModelsEnabled="true"
enhancementEnabled="true"
lazyLoadingEnabled="true"
errorTracingEnabled="true"
maxRequests="32"
maxSessions="10"
maxTransactions="5"
useStatementNamespaces="false"
/>
NOKIA5320XM 2010-01-07
  • 打赏
  • 举报
回复
我用的是ibatis 的缓存机制。没有用其它的第三方插件
  • 打赏
  • 举报
回复
查询要返回的
返回配置呢

还有Bean

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧