spring事务管理配置
数据源定义:
<bean id="dataSource"
value="com.sybase.jdbc3.jdbc.SybDriver"></property>
<property name="url" value="jdbc:sybase:Tds:10.71.153.250:2988/nethouse"></property>
<property name="username" value="nethouse"></property>
<property name="password" value="nethouse"></property>
<property name="initialSize" value="1"></property>
<property name="maxActive" value="500"></property>
<property name="maxIdle" value="5"></property>
<property name="minIdle" value="1"></property>
</bean>
数据源工厂:
<bean id="sqlMapClient"
/>
<property name="dataSource" ref="dataSource" />
</bean>
事务控制:
<bean id="transactionManager"
ref="dataSource" />
</bean>
事务处理:
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="modify*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="allManagerMethod"
expression="execution (* com.huawei.demo.*.*.*.*(..))" />
<aop:advisor advice-ref="txAdvice"
pointcut-ref="allManagerMethod" />
</aop:config>