`

【转】SqlMapConfig.xml中的setting属性设置

 
阅读更多

 

 1<settings
 2    cacheModelsEnabled="true"
 3    lazyLoadingEnabled="false"
 4    enhancementEnabled="true"
 5    maxSessions="64"
 6    maxTransactions="8"
 7    maxRequests="128"
 8    useStatementNamespaces="false"
 9    classInfoCacheEnabled="true"
10    errorTracingEnabled="true"
11    defaultStatementTimeout=""
12    statementCachingEnabled="true"
13/>


<!--
 
maxRequests
 同时执行 SQL 语句的最大线程数。大于这个值的线程将阻塞直到另一个线程执行完成。不同的 DBMS有不同的限制值,但任何数据库都有这些限制。通常这个值应该至少是maxTransactions(参见以下)的 10 倍,并且总是大于 maxSessions 和maxTranactions。减小这个参数值通常能提高性能。
 
 例如:maxRequests=“256”
 缺省值:512
 
 maxSessions
 同一时间内活动的最大 session 数。一个 session 可以maxSessions是代码请求的显式 session,也可以是当线程使用SqlMapClient 实例(即执行一条语句)自动获得的session。它应该总是大于或等于 maxTransactions 并小于 maxRequests。减小这个参数值通常能减少内存使用。
 
 例如:maxSessions=“64”
 缺省值:128
 
 
maxTransactions
 同时进入 SqlMapClient.startTransaction()的最大线程maxTransactions 数。大于这个值的线程将阻塞直到另一个线程退出。不同的 DBMS 有不同的限制值,但任何数据库都有这些限制。这个参数值应该总是小于或等于maxSessions 并总是远远小于 maxRequests。减小这个参数值通常能提高性能。
 
 例如:maxTransactions=“16”
 缺省值:32
 
 cacheModelsEnabled
 全局性地启用或禁用 SqlMapClient 的所有缓存cacheModelsEnabled model。调试程序时使用。
 
 例如:cacheModelsEnabled=“true”
 缺省值:true(启用)
 
 
lazyLoadingEnabled
 全局性地启用或禁用SqlMapClient的所有延迟加载。lazyLoadingEnabled 调试程序时使用。
 例子:lazyLoadingEnabled=“true”
 缺省值:true(启用)
 
 enhancementEnabled
 全局性地启用或禁用运行时字节码增强,以优化访enhancementEnabled
 问Java Bean属性的性能,同时优化延迟加载的性能。
 
 例子:enhancementEnabled=“true”
 缺省值:false(禁用)
 
 
useStatementNamespaces
 如果启用本属性,必须使用全限定名来引用 mapped useStatementNamespaces
 statement。Mapped statement 的全限定名由 sql-map 的名称和 mapped-statement 的名称合成。例如: queryForObject("sqlMapName.statementName");
 
 例如:useStatementNamespaces=“false”
 缺省值:false(禁用)

来源:(http://blog.sina.com.cn/s/blog_44167fca0100eiqx.html) - SqlMapConfig.xml中的setting属性设置_leozwf_新浪博客

 defaultStatementTimeout
 此设置值必须为一个整数,作为JDBC连接超时的时间,这个值可以被任意一个映射文件的statement属性来重新设置,
 如果没有指明,查询将无超时时间限制除非在映射文件中设置statement属性值。被设置的值以秒为单位等待连接失效
  
 classInfoCacheEnabled 
 With this setting enabled, iBATIS will maintain a cache of introspected
 classes. This will lead to a significant reduction in startup time if many
 classes are reused.
 例如: classInfoCacheEnabled=“true”
 缺省值: true (启用)
 
 statementCachingEnabled (iBATIS 2.3.0以后版本中有)
 With this setting enabled, iBATIS will maintain a local cache of
 prepared statements. This can lead to significant performance
 improvements.
 例如: statementCachingEnabled=“true”
 缺省值: true (启用)
-->

来源:(http://blog.sina.com.cn/s/blog_44167fca0100eiqx.html) - SqlMapConfig.xml中的setting属性设置_leozwf_新浪博客
分享到:
评论

相关推荐

    MyBatis SqlMapConfig.xml配置

    MyBatis 的核心配置文件SqlMapConfig.xml,接下来通过本文给大家介绍MyBatis SqlMapConfig.xml配置,非常不错,感兴趣的朋友一起学习吧

    SqlMapConfig.xml

    《jy-10-SPRINGMYBATIS01——MyBatis-程祖红/刘苍松》所需文件

    黑马程序员mybatis教程第一天:SqlMapConfig.xml(1).pdf

    黑马程序员mybatis教程第一天:SqlMapConfig.xml(1).pdf

    ibatis 连接字符串 SqlMapConfig.xml

    NULL 博文链接:https://wuxiubing.iteye.com/blog/1010635

    SqlMapConfig.xsd

    SqlMapConfig.xsd SqlMapConfig.xsd

    ssm配置文件spring.xml

    ssm配置文件spring.xml

    struts2+spring2+ibates

    4、sqlmapconfig.xml中传入参数和result的设置,只需要将得到的值result映射到有此属性的类对象. 5、JSP/Servlet中获得当前应用的相对路径和绝对路径 JSP中获得当前应用的相对路径和绝对路径 根目录所对应的绝对...

    ssm整合,crm客户管理

    1、SqlMapConfig.xml,空文件即可,但是需要文件头。 2、applicationContext-dao.xml a) 数据库连接Druid b) SqlSessionFactory对象,需要spring和mybatis整合包下的。 c) 配置mapper文件扫描器。Mapper动态代理开发...

    mybatis 一对多多对多案例详解

    mybatis 一对多多对多案例详解 1、首先 准备sql 数据 user(用户表) role(角色...4、编写UserDao,RoleDao以及映射文件UserDaoMapping.xml ,RoleDaoMapping.xml和主配置文件SqlMapConfig.xml,下面上代码 5、编写测试类

    ibatis配置文件

    ibatis ibatis学习笔记(一)&gt;&gt;&gt;&gt;&gt;&gt;&gt;sqlMapConfig.xml文件详解

    MyBatis学习手册及配置文件

    关于MyBatis的学习资料,SqlMapConfig.xml Mapper.xml配置

    开发搭建工具

    powerdesigner125Crack.rar visio_pro_2003_chs_cdkey.txt 2010.1到2010.7的项目sichuanTelecommunication 的静态页面 Account.xml ApplicationAction.xml ...SqlMapConfig.xml struts.xml web.xml

    Mybaties1Demo

    mybatis示列,包括输入映射,输出映射,动态sql,sqlmapconfig.xml的配置

    原创的一个iBatis例子

    SqlMapConfig.xml:SqlMap配置,在最后应该加上每个表的Map文件,特别注意useStatementNamespaces="true"不能为false org:生成的代码,分为三个目录,目录名在ibatorConfig.xml中指定 注意:其中生成的person_...

    SpringMVC-03教案1

    3.3.2视频详情3.3.3总结与补充把SqlMapConfig.xml配置文件中的内容配置到applicationContext.xml配置文件中在Accou

    mybaitis_first_根据用户id查询

    mybatis框架需要加载映射文件,将Users.xml添加在SqlMapConfig.xml,如下

    传智播客ibatis视频教程源代码

    Reader reader = com.ibatis.common.resources.Resources.getResourceAsReader("com/itcast/SqlMapConfig.xml"); sqlMapClient = com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(reader); ...

Global site tag (gtag.js) - Google Analytics