<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<!-- 数据源配置,使用应用内的DBCP数据库连接池 -->
<!-- mysql数据源配置,使用应用内的DBCP数据库连接池 -->
<bean id="dataSource_stats_db" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>${jdbc.mysql.driverClassName}</value>
</property>
<property name="url">
<value>${jdbc.stats_db.url}</value>
</property>
<property name="username">
<value>${jdbc.stats_db.mysql.username}</value>
</property>
<property name="password">
<value>${jdbc.stats_db.mysql.password}</value>
</property>
<property name="maxActive">
<value>${jdbc.mysql.maxActive}</value>
</property>
<property name="maxWait">
<value>${jdbc.mysql.maxWait}</value>
</property>
<property name="maxIdle">
<value>${jdbc.mysql.maxIdle}</value>
</property>
<property name="initialSize">
<value>${jdbc.mysql.initSize}</value>
</property>
<property name="removeAbandoned">
<value>true</value>
</property>
<property name="defaultAutoCommit">
<value>true</value>
</property>
<property name="defaultReadOnly">
<value>false</value>
</property>
<property name="testOnBorrow">
<value>true</value>
</property>
<property name="validationQuery">
<value>select 1</value>
</property>
</bean>
<bean id="sqlSessionFactory_stats_db" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource_stats_db" />
<property name="configLocation" value="classpath:mysqlmap-config.xml" />
<property name="mapperLocations">
<value>classpath*:com/pingan/haofang/mysql/*.xml</value>
</property>
</bean>
<bean id="sqlSession_stats_db" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype">
<constructor-arg index="0" ref="sqlSessionFactory_stats_db" />
</bean>
<!-- 添加Spring的JDBC操作的Template Bean -->
<bean id="jdbcTemplate_stats_db" class="org.springframework.jdbc.core.JdbcTemplate" >
<property name="dataSource">
<ref bean="dataSource_stats_db" />
</property>
</bean>
<!-- 连接事务的注解配置 <tx:annotation-driven transaction-manager="transactionManager"/> -->
<!-- Transaction manager for a single JDBC DataSource -->
<bean id="transactionManager_stats_db"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource_stats_db" />
</bean>
<tx:advice id="txAdvice_stats_db" transaction-manager="transactionManager_stats_db">
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="*" propagation="REQUIRED" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="allManagerMethod_stats_db"
expression="execution(* com.pingan.haofang..*.*service.impl.*(..))" />
<aop:advisor advice-ref="txAdvice_stats_db" pointcut-ref="allManagerMethod_stats_db" />
</aop:config>
</beans>
分享到:
相关推荐
spring-core-4.1.6.RELEASE.jar spring-core-4.3.10.RELEASE.jar spring-core-4.3.12.RELEASE.jar spring-core-4.3.13.RELEASE.jar spring-core-4.3.14.RELEASE.jar spring-core-4.3.16.RELEASE.jar spring-core-4.3...
spring-tool-suite-3.9.9.RELEASE-e4.11.0-win32-x86_64.zip
spring-tool-suite-4-4.13.0.RELEASE-e4.22.0-macosx.cocoa.x86_64.dmg
spring-tx-5.0.0.0.RELEASE.jar是一个jar包,是项目额依赖文件,可以下载直接引入项目使用
spring-tool-suite-3.8.4.RELEASE-e4.6.3-win32-x86_64
spring-tool-suite-4-4.9.0.RELEASE-e4.18.0-win32.win32.x86_64.self-extracting.jar
spring-tool-suite-4-4.8.1.RELEASE-e4.17.0-win32.win32.x86_64.self-extracting.jar
spring-aop-4.1.6.RELEASE.jar spring-aspects-4.1.6.RELEASE.jar spring-beans-4.1.6.RELEASE.jar spring-context-4.1.6.RELEASE.jar spring-context-support-4.1.6.RELEASE.jar spring-core-4.1.6.RELEASE.jar ...
spring-tool-suite-3.9.5.RELEASE-e4.8.0-win32-x86_64
spring-framework-reference.pdf、Spring-Reference_2.5_zh_CN.chm
spring-jdbc-4.3.6.RELEASE.jar
spring-tool-suite-4-4.8.0.RELEASE-e4.17.0-win32.win32.x86_64.self-extracting.jar
spring-tx-4.0.6.RELEASE.jar spring-tx-4.0.6.RELEASE.jar
官方原版源码spring-framework-5.1.6.RELEASE.zip
spring-aop-3.2.0.RELEASE.jar,一个Spring中AOP的jar包
spring-tool-suite-4-4.7.0.RELEASE-e4.16.0-win32.win32.x86_64.self-extracting spring tool suite解压即可使用,自带eclipse
最新struts2-spring-plugin-2.3.24.1.jar
org.springframework.spring-library-3.0.4.RELEASE.libd org.springframework.test-3.0.4.RELEASE.jar org.springframework.transaction-3.0.4.RELEASE.jar org.springframework.web.portlet-3.0.4.RELEASE.jar ...
spring-context-4.2.4.RELEASE.jar,spring-context-4.2.4.RELEASE包
spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是独立的,我列了目录,可以只下载需要的包,这是1号包: 1号包: edu.emory.mathcs.backport edu.oswego.cs....