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>
spring c3p0 配置的更多相关文章
- spring下配置dbcp,c3p0,proxool[转]
不管通过何种持久化技术,都必须通过数据连接访问数据库,在Spring中,数据连接是通过数据源获得的.在以往的应用中,数据源一般是Web应用服务器提供的.在Spring中,你不但可以通过JNDI获取应用 ...
- Spring中的c3p0配置
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/51162560 今天,我们就来详细谈谈Spring中的c3p0配置问题,好了,不耽搁 ...
- spring中通过JNDI、DBCP、C3P0配置数据源
JNDI配置数据源 1.首先在tomcat的server.xml中配置数据源信息,找到Context,然后在里边加入如下代码 <Context docBase="SpringDemo& ...
- c3p0配置详解
数据库连接池C3P0框架是个非常优异的开源jar,高性能的管理着数据源,这里只讨论程序本身负责数据源,不讨论容器管理. 一.实现方式: C3P0有三种方式实现: 1.自己动手写代码,实现数据源 例如: ...
- Spring c3p0连接池无法释放解决方案
通过c3p0配置连接池的时候,在进行压力测试的时候,日志出现了这样一个错误:Data source rejected establishment of connection, message from ...
- 基于注解的Spring事务配置
spring采用@Transactional注解进行事务申明,@Transactional既可以在方法上申明,也可以在类上申明,方法申明优先于类申明. 1.pom配置 包括spring核心包引入以及s ...
- C3P0配置实战
C3P0: 一个开源的JDBC连接池,它实现了数据源和JNDI绑定,支持JDBC3规范和JDBC2的标准扩展.目前使用它的开源项目有Hibernate,Spring等. 默认情况下(即没有配置连接池的 ...
- spring+hibernate 配置多个数据源过程 以及 spring中数据源的配置方式
spring+hibernate 配置多个数据源过程 以及 spring中数据源的配置方式[部分内容转载] 2018年03月27日 18:58:41 守望dfdfdf 阅读数:62更多 个人分类: 工 ...
- spring中配置数据源
spring中配置数据源的几种常见方式: #mysql 数据库配置(jdbc.properties) jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.u ...
随机推荐
- 【LeetCode】4. Median of Two Sorted Arrays (2 solutions)
Median of Two Sorted Arrays There are two sorted arrays A and B of size m and n respectively. Find t ...
- List<String> bikeList = Arrays.asList(bikeuuids);
最近项目中 List<String> bikeList = Arrays.asList(bikeuuids);报错 而且console里面没有特别有用的 bikeList.add(&qu ...
- Android 桌面部件
桌面部件是一种利用AppWidget框架将应用程序的某个部件放在桌面. res/layout/digitalclock.xml <?xml version="1.0" enc ...
- Kubernetes(k8s) docker集群搭建
原文地址:https://blog.csdn.net/real_myth/article/details/78719244 一.Kubernetes系列之介绍篇 •Kubernetes介绍 1.背 ...
- Swift 基础知识
前言 Swift 是一门强类型语言,全面支持 Unicode 编码. Swift 中的定义和实现是在同一个单元中的,通常一个 Swift 源代码单文件是以 .swift 结尾的. Swift 不需要单 ...
- request.getRequestURI() 、request.getRequestURL() 、request.getContextPath()、request.getServletPath()区别
request.getRequestURI() /jqueryWeb/resources/request.jsprequest.getRequestURL() http://localhost:808 ...
- Linux共享内存使用常见陷阱与分析
所谓共享内存就是使得多个进程可以访问同一块内存空间,是最快的可用IPC形式.是针对其他通信机制运行效率较低而设计的.往往与其它通信机制,如 信号量结合使用,来达到进程间的同步及互斥.其他进程能把同一段 ...
- STM8的数据@near @tiny定义
总是记不住这个:stm8 stvd下 near等于51的xdata tiny等于51的idata http://www.waveshare.net/article/STM8-3-1-10.htm 如何 ...
- Nuxt 开发环境不支持ip访问?
传送门:https://nuxtjs.org/faq/host-port 开发模式下不支持ip访问? 打开package.json,添加如下配置,然后重启即可. "config": ...
- js页面加载完后执行(document.onreadystatechange 和 document.readyState)
js页面加载完后执行javascript(document.onreadystatechange 和 document.readyState) document.onreadystatechange ...