|
@@ -3,12 +3,15 @@
|
3
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
4
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
5
|
5
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
6
|
+ xmlns:aop="http://www.springframework.org/schema/aop"
|
6
|
7
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
7
|
8
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
8
|
9
|
http://www.springframework.org/schema/tx
|
9
|
10
|
https://www.springframework.org/schema/tx/spring-tx.xsd
|
10
|
11
|
http://www.springframework.org/schema/context
|
11
|
12
|
https://www.springframework.org/schema/context/spring-context.xsd
|
|
13
|
+ http://www.springframework.org/schema/aop
|
|
14
|
+ https://www.springframework.org/schema/aop/spring-aop.xsd
|
12
|
15
|
">
|
13
|
16
|
<context:property-placeholder location="jdbc.properties"></context:property-placeholder>
|
14
|
17
|
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
|
|
@@ -16,6 +19,7 @@
|
16
|
19
|
<property name="url" value="${jdbc.url}"></property>
|
17
|
20
|
<property name="username" value="${jdbc.username}"></property>
|
18
|
21
|
<property name="password" value="${jdbc.password}"></property>
|
|
22
|
+<!-- <property name="defaultAutoCommit" value="false"></property>-->
|
19
|
23
|
</bean>
|
20
|
24
|
<bean id="jdbcTemp" class="org.springframework.jdbc.core.JdbcTemplate">
|
21
|
25
|
<property name="dataSource" ref="dataSource"></property>
|
|
@@ -27,6 +31,16 @@
|
27
|
31
|
<property name="accountDao" ref="accountDao">
|
28
|
32
|
</property>
|
29
|
33
|
</bean>
|
30
|
|
-
|
|
34
|
+ <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
|
35
|
+ <property name="dataSource" ref="dataSource"></property>
|
|
36
|
+ </bean>
|
|
37
|
+<!-- <tx:advice id="interceptor" transaction-manager="transactionManager">-->
|
|
38
|
+<!-- <tx:attributes>-->
|
|
39
|
+<!-- <tx:method name="transfer" rollback-for="java.lang.Exception" timeout="-1"/>-->
|
|
40
|
+<!-- </tx:attributes>-->
|
|
41
|
+<!-- </tx:advice>-->
|
|
42
|
+<!-- <aop:config>-->
|
|
43
|
+<!-- <aop:advisor advice-ref="interceptor" pointcut="execution(* com.transaction_.service.impl.AccountServiceImpl.*(..))"></aop:advisor>-->
|
|
44
|
+<!-- </aop:config>-->
|
31
|
45
|
|
32
|
46
|
</beans>
|