1. DataSource
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="username" value="wenyep" /> -->
<property name="url" value="jdbc:mysql://110.110.110.110:3306/ams?useUnicode=true&characterEncoding=UTF-8" />
<property name="username" value="root" />
<property name="password" value="123456" />
<property name="maxIdle" value="30"></property>
<property name="minIdle" value="15"></property>
<property name="maxActive" value="100"></property>
<property name="initialSize" value="20"></property>
</bean>
2. transactionManager
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="copy*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="parse**">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="remove*">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="delete*">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="confirm**">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="insert*">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
4. 在service层加上事物管理, 在service的bean上加上 parent="txProxyTemplate"
<bean id="sysUsersService" parent="txProxyTemplate">
<property name="target">
<bean class="com.platform.app.service.SysUsersServiceImpl">
<property name="sysUsersDAO" ref="sysUsersDAO" />
</bean>
</property>
</bean>