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 ...
随机推荐
- 搭建简单的网络部分(OC)框架
准备工作 1.文件目录结构示图(按照MVC分层) 文件目录结构图/自定义Cell Controller: CYXOneViewController Model: CYXMenu View: CYXCe ...
- Win7 U盘安装Ubuntu16.04 双系统详细教程(方法一)
主要分为以下几步: 一. 下载Ubuntu 16.04镜像软件: 二. 制作U盘启动盘使用ultraISO: 三. 安装Ubuntu系统: 四. 用EasyBCD 创建启动系统启动引导: (根据个人情 ...
- mysql基本语句集合
一.概述 1.删除字段 alter table {table_name} drop column {column_name}; 2.添加字段 alter table {table_name} Add ...
- 【MySQL】MySQL之浅谈MySQL的存储引擎
什么是MySql数据库 通常意义上,数据库也就是数据的集合,具体到计算机上数据库可以是存储器上一些文件的集合或者一些内存数据的集合. 我们通常说的MySql数据库,sql server数据库等 ...
- Android Studio每日小技巧
一般的什么快捷键,技巧的文章也有很多.我也看过很多.下面这些事我在来自国外大神发布的:Android Studio Tips of the Day查看到的,而且对于我来说有帮助的及没用过的. Andr ...
- OpenCV 学习笔记03 边界框、最小矩形区域和最小闭圆的轮廓
本节代码使用的opencv-python 4.0.1,numpy 1.15.4 + mkl 使用图片为 Mjolnir_Round_Car_Magnet_300x300.jpg 代码如下: impor ...
- 【转】Kotlin 和 Checked Exception
Kotlin 和 Checked Exception 最近 JetBrains 的 Kotlin 语言忽然成了热门话题.国内小编们传言说,Kotlin 取代了 Java,成为了 Android 的“钦 ...
- JAVA Socket编程和C++ Socket编程有什么不同
原文链接: http://zhidao.baidu.com/link?url=16TEzhom2Nr8x1_2uTRp-e2pgZRgS5nW5ywtRX2XLHbtLOG8btif5DTyP85jf ...
- winform中键盘和鼠标事件的捕捉和重写
在编写winform应用程序时,有时需要无论在哪个控件获取焦点时,对某一个键盘输入或者鼠标事件都进行同样的操作.比如编写一个处理图片的应用程序时,希望无论当前哪个控件获得焦点,当用户按上.下.左.右键 ...
- spring 下载
Spring官网(https://spring.io/)改版后,直接下载Jar包的链接,下面汇总 1.直接输入地址,改相应版本即可:http://repo.springsource.org/libs- ...