日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

Spring AOP在事务中的应用典范

發布時間:2024/4/13 javascript 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Spring AOP在事务中的应用典范 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<?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:tx="http://www.springframework.org/schema/tx"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"><bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close" autowire="no"><property name="url" value="jdbc:mysql://localhost:3306/mytest?serverTimezone=UTC"></property><property name="username" value="root"></property><property name="password" value="operater"></property><property name="driverClassName" value="com.mysql.cj.jdbc.Driver"></property><property name="minIdle" value="1"/><property name="maxIdle" value="5"/><property name="maxActive" value="100"/><property name="initialSize" value="1"/><property name="testOnBorrow" value="true"/><property name="validationQuery" value="select 1"/><property name="testOnReturn" value="true"/><property name="validationInterval" value="500000"/><property name="removeAbandoned" value="true"/><property name="removeAbandonedTimeout" value="30"/><property name="fairQueue" value="false"/><property name="defaultAutoCommit" value="false"/></bean><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource" ref="dataSource"/></bean><bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"><property name="dataSource" ref="dataSource"></property></bean><bean id="studentDao" class="com.leon.spring.dao.impl.StudentDaoImpl"><property name="jdbcTemplate" ref="jdbcTemplate"/></bean><bean id="studentService" class="com.leon.spring.service.impl.StudentServiceImpl"><property name="studentDao" ref="studentDao"/></bean><bean id="studentServiceProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"><property name="transactionManager" ref="transactionManager" /><property name="target" ref="studentService"/><property name="transactionAttributes"><props><prop key="save*">PROPAGATION_REQUIRED</prop><prop key="update*">PROPAGATION_REQUIRED</prop><prop key="remove*">PROPAGATION_REQUIRED</prop><prop key="get*">PROPAGATION_REQUIRED,readOnly</prop></props></property></bean></beans>

?

總結

以上是生活随笔為你收集整理的Spring AOP在事务中的应用典范的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。