SqlMapConfig.xml中JDBC事务管理SIMPLE dataSource的相关属性配置

来源:互联网 发布:jsp怎么和js交互 编辑:程序博客网 时间:2024/06/08 00:50
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE sqlMapConfigPUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN""http://www.ibatis.com/dtd/sql-map-config-2.dtd"><sqlMapConfig><properties resource="cn/ustc/edu/montype/db.properties" /><settings cacheModelsEnabled="true" enhancementEnabled="true"lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"maxTransactions="5" useStatementNamespaces="false" /><transactionManager type="JDBC"><dataSource type="SIMPLE"><property name="JDBC.Driver" value="${driver}" /><property name="JDBC.ConnectionURL"value="${url}" /><property name="JDBC.Username" value="${username}" /><property name="JDBC.Password" value="${password}" /><property name="JDBC.DefaultAutoCommit" value="true" /><property name="Pool.MaximumActiveConnections" value="10" /><property name="Pool.MaximumIdleConnections" value="5" /><property name="Pool.MaximumCheckoutTime" value="120000" /><property name="Pool.TimeToWait" value="500" />15 | P a g e<property name="Pool.PingQuery" value="select 1 from DUAL" /><property name="Pool.PingEnabled" value="false" /><property name="Pool.PingConnectionsOlderThan" value="1" /><property name="Pool.PingConnectionsNotUsedFor" value="1" /></dataSource></transactionManager><sqlMap resource="cn/ustc/edu/montype/monitor.xml" /></sqlMapConfig>


+Properties:sqlMapConfig has only one properties tag to load a outside properties file,for example,read the db connection info.
+settings:
--+cacheModelsEnabled:whether enable cache model or not.
--+enhancementEnabled: whether enable runtime bytecode enhancement, To optimize the performance of Java Bean properties while optimizing the performance of lazy loading.
--+lazyLoadingEnabled: whether enable SqlMapClient lazy loading.
--+maxRequests: The maximum number of threads that execute SQL statements.
--+useStatementNamespaces:falsenot use the fully qualified name.
+transactionManager:
--+type:JDBC manager transactions.
--+dataSource:
----+type:SIMPLE It is based on the iBatis SimpleDataSource connection pool implementation.
----+JDBC.DefaultAutoCommit:true means auto commit.
----+Pool.MaximumActiveConnections: maximum capacity of the database connection pool can be maintained.
----+Pool.MaximumIdleConnections: Database connections number of connections allowed in the pool pending.
----+Pool.MaximumCheckoutTime:maximum time of one connection can be used.(more than ,it will end).
----+Pool.TimeToWait:maximum time of a Thread wait to get connection.(no connections in pool,so wait)
----+Pool.PingQuery:check whether the connection is valid by the simplest sql “SELECT 1 FROM DUAL”.
----+Pool.PingEnabled:check or not.
----+Pool.PingConnectionsOlderThan:Check Connection if connection time exceed the value.
----+Pool.PingConnectionsNotUsedFor:Check Connection if connection is not used exceed the value


You can contact me if you don't understand the meaning ...


个人链接:
--------------------------------
JavaMail实现(JAVA <wbr><wbr><wbr>SWING)新浪微博:http://weibo.com/cwtree

       JavaMail实现(JAVA <wbr><wbr><wbr>SWING)人人首页:www.renren.com/treelovexiaobei

       JavaMail实现(JAVA <wbr><wbr><wbr>SWING)优酷空间: http://i.youku.com/cwtree

       JavaMail实现(JAVA <wbr><wbr><wbr>SWING)科大首页:http://home.ustc.edu.cn/~cwtree/
--------------------------------


原创粉丝点击