spring c3p0 配置
<?xml version="1.0" encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-2.0.xsd"default-destroy-method="close"><importresource="spring_eqms.xml"/><beanid="dataSource"class="com.mchange.v2.c3p0.ComboPooledDataSource"destroy-method="close"><propertyname="driverClass"value="com.mysql.jdbc.Driver"/><propertyname="jdbcUrl"value="jdbc:mysql://xxx:3306/tzerp_db?useUnicode=true&characterEncoding=UTF-8"/><propertyname="user"value="root"/><propertyname="password"value="root"/><!--当连接池中的连接用完时,C3P0一次性创建新连接的数目--><propertyname="acquireIncrement"value="10"/><!-- 定义在从数据库获取新连接失败后重复尝试获取的次数,默认为30--><propertyname="acquireRetryAttempts"value="100"/><!-- 两次连接中间隔时间,单位毫秒,默认为1000 --><propertyname="acquireRetryDelay"value="1000"/><!-- 连接关闭时默认将所有未提交的操作回滚。默认为false --><propertyname="autoCommitOnClose"value="false"/><!-- 获取连接失败将会引起所有等待获取连接的线程抛出异常。但是数据源仍有效保留,并在下次调19.用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试获取连接失败后该数据源将申明已断开并永久关闭。默认为 false; --><propertyname="breakAfterAcquireFailure"value="false"/><!--22.当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出SQLException,如设为0则无限期等待。单位毫秒,默认为0;23.--><propertyname="checkoutTimeout"value="0"/><!-- 始化时创建的连接数,应在minPoolSize与maxPoolSize之间取值。默认为3;--><!-- 最大空闲时间,超过空闲时间的连接将被丢弃。为0或负数则永不丢弃。默认为0; --><propertyname="maxIdleTime"value="10000"/><!-- 接池中保留的最大连接数。默认为15--><propertyname="minPoolSize"><value>10</value></property><propertyname="initialPoolSize"value="20"/><propertyname="maxPoolSize"value="50"/><!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatement数量。但由于预缓存的Statement属32.于单个Connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素,如果maxStatements与33.maxStatementsPerConnection均为0,则缓存被关闭。默认为0; --><propertyname="maxStatements"value="0"/><!-- 连接池内单个连接所拥有的最大缓存Statement数。默认为0; --><propertyname="maxStatementsPerConnection"value="0"/><!--C3P0是异步操作的,缓慢的JDBC操作通过帮助进程完成。扩展这些操作可以有效的提升性能,通过多线程实现多个操作同时被执行。默认为3;38.--><propertyname="numHelperThreads"value="3"/><!-- 用户修改系统配置参数执行前最多等待的秒数。默认为300; --><propertyname="propertyCycle"value="600"/></bean><beanid="sessionFactory"class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><propertyname="dataSource"><refbean="dataSource"/></property><propertyname="hibernateProperties"><props><propkey="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><propkey="hibernate.show_sql">true</prop></props></property><propertyname="mappingResources"><list><value>entitys/Ryb.hbm.xml</value><value>entitys/Dingdanmx.hbm.xml</value><value>entitys/Cpgxclb.hbm.xml</value><value>entitys/Caigoudanmx.hbm.xml</value><value>entitys/Gxb.hbm.xml</value><value>entitys/Gxwfmxb.hbm.xml</value><value>entitys/Gxwfzb.hbm.xml</value><value>entitys/Caigoudan.hbm.xml</value><value>entitys/UserQxb.hbm.xml</value><value>entitys/Gys.hbm.xml</value><value>entitys/Lzsjs.hbm.xml</value><value>entitys/Wlgs.hbm.xml</value><value>entitys/Zdbhb.hbm.xml</value><value>entitys/Cyclb.hbm.xml</value><value>entitys/Hjb.hbm.xml</value><value>entitys/Toexcel.hbm.xml</value><value>entitys/UserGlb.hbm.xml</value><value>entitys/User.hbm.xml</value><value>entitys/Dingdan.hbm.xml</value><value>entitys/Gsjsb.hbm.xml</value><value>entitys/Qxb.hbm.xml</value><value>entitys/Glb.hbm.xml</value><value>entitys/Cpclxxzb.hbm.xml</value><value>entitys/Cpgxgys.hbm.xml</value><value>entitys/Jgll.hbm.xml</value><value>entitys/Xzfldset.hbm.xml</value><value>entitys/Cpgxb.hbm.xml</value><value>entitys/Cpclxxmxb.hbm.xml</value><value>entitys/Rjzc.hbm.xml</value><value>entitys/Bmb.hbm.xml</value><value>entitys/Syb.hbm.xml</value><value>entitys/Kehu.hbm.xml</value></list></property></bean><beanid="myHibTransactionManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager"><propertyname="sessionFactory"ref="sessionFactory"/></bean><tx:adviceid="txAdvice"transaction-manager="myHibTransactionManager"><tx:attributes><tx:methodname="add*"propagation="REQUIRED"/><tx:methodname="del*"propagation="REQUIRED"/><tx:methodname="update*"propagation="REQUIRED"/><tx:methodname="reg*"propagation="REQUIRED"/><tx:methodname="save*"propagation="REQUIRED"/><tx:methodname="get*"propagation="SUPPORTS"read-only="true"/><tx:methodname="find*"propagation="SUPPORTS"read-only="true"/><tx:methodname="login*"propagation="SUPPORTS"read-only="true"/></tx:attributes></tx:advice><aop:config><aop:pointcutid="bizMethods"expression="execution(* services.*.*(..))"/><aop:advisoradvice-ref="txAdvice"pointcut-ref="bizMethods"/></aop:config><beanid="baseDao"class="daos.BaseDao"><propertyname="sessionFactory"><refbean="sessionFactory"/></property></bean><beanid="eqmsService"class="services.EqmsServiceImpl"parent="baseDao"></bean></beans>