千山我独行,不必相送...
Angi For Ever
Spring管理iBatis事务
<sqlMapConfig>
<sqlMap resource="com/angi/ibatis/maps/User.xml" />
</sqlMapConfig>
以上配置省去了transactionManager的配置,就会使用external(外部)事务管理(ExternalTransaction),即等同如下配置:
复制代码
<sqlMapConfig>
<transactionManager type="EXTERNAL">
<!--这个数据源其实没有什么意义,还是取上面的省略方式吧-->
<dataSource type="DBCP">
</dataSource>
</transactionManager>
<sqlMap resource="com/angi/ibatis/maps/User.xml" />
</sqlMapConfig>
复制代码
1、TransactionProxyFactoryBean
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
<bean id="userServiceProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userService" />
</property>
<property name="transactionAttributes">
<props>
<!-- 这里的方法签名可以精确到方法, 先懒惰一下全配置上 -->
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
复制代码
2、TransactionInterceptor
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
<bean
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>userService</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<!-- 这里的方法签名可以精确到方法, 先懒惰一下全配置上 -->
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
复制代码
3、AOP和TX配置
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 需要引入aop的命名空间 -->
<aop:config>
<!-- 切入点指明了在所有方法产生事务拦截操作 -->
<aop:pointcut id="serviceMethods"
expression="execution(* com.angi.ibatis.service.*.*(..))" />
<!-- 定义了将采用何种拦截操作,这里引用到 txAdvice -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethods" />
</aop:config>
<!-- 需要引入tx的命名空间 -->
<!-- 这是事务通知操作,使用的事务管理器引用自 transactionManager -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 指定哪些方法需要加入事务,这里懒惰一下全部加入,可以使用通配符来只加入需要的方法 -->
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
</beans>
复制代码
4、anotation
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- 需要引入tx的命名空间 -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
</beans>
复制代码
Java代码:
复制代码
@Transactional
public void doTransaction() {
User user = new User();
user.setName("11111");
user.setSex(1);
userDao.saveUser(user);
User user1 = new User();
user1.setName("Angikkk");
user1.setSex(1);
userDao.saveUser(user1);
复制代码
}
分类: iBatis, Spring
绿色通道: 好文要顶 关注我 收藏该文与我联系
Angi
关注 - 0
粉丝 - 5
+加关注
2 0
(请您对文章做出评价)
» 下一篇:Java安全领域组成部分
posted on 2011-04-07 10:28 Angi 阅读(8142) 评论(0) 编辑 收藏
刷新评论刷新页面返回顶部
(评论功能已被禁用)
博客园首页博问新闻闪存程序员招聘知识库
最新IT新闻:
· 微信群升级:人数允许超100人 需开通微信支付
· 苹果挖豪雅销售总监 为推出iWatch进行准备
· 我们反对无趣!来游戏化吧
· Linux 3.14将是下一个长期支持内核
· 研究发现人类不喜欢独自思考
» 更多新闻...
最新知识库文章:
· 程序员的自我修养(2)——计算机网络
· 你是否中了工程师文化的毒?
· 不安分的工程师
· 流量劫持——浮层登录框的隐患
· Amazon前技术副总裁解剖完美技术面试
» 更多知识库文章...
Powered by:
博客园
Copyright © Angi
导航
管理
搜索
随笔分类
《Java加密与解密的艺术》读书笔记(10)
文章分类
Agile(1)
Android(3)
Architecture(2)
CSS(3)
Database(5)
DB2(19)
Eclipse(9)
Flash(1)
FreeMarker(2)
Hibernate(2)
iBatis(2)
Java EE(10)
Java SE(22)
JavaScript(7)
JBoss(2)
jQuery(3)
LDAP(1)
Linux(5)
Maven(7)
Microsoft(2)
Oracle(1)
POI(1)
Security(15)
Spring(3)
Spring Batch(2)
Spring Batch Admin(4)
Spring Security(7)
SSO(2)
Struts1(2)
Struts2(1)
Tomcat(7)
Web(7)
Angi For Ever
Spring管理iBatis事务
<sqlMapConfig>
<sqlMap resource="com/angi/ibatis/maps/User.xml" />
</sqlMapConfig>
以上配置省去了transactionManager的配置,就会使用external(外部)事务管理(ExternalTransaction),即等同如下配置:
复制代码
<sqlMapConfig>
<transactionManager type="EXTERNAL">
<!--这个数据源其实没有什么意义,还是取上面的省略方式吧-->
<dataSource type="DBCP">
</dataSource>
</transactionManager>
<sqlMap resource="com/angi/ibatis/maps/User.xml" />
</sqlMapConfig>
复制代码
1、TransactionProxyFactoryBean
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
<bean id="userServiceProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userService" />
</property>
<property name="transactionAttributes">
<props>
<!-- 这里的方法签名可以精确到方法, 先懒惰一下全配置上 -->
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
复制代码
2、TransactionInterceptor
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
<bean
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>userService</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<!-- 这里的方法签名可以精确到方法, 先懒惰一下全配置上 -->
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
复制代码
3、AOP和TX配置
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 需要引入aop的命名空间 -->
<aop:config>
<!-- 切入点指明了在所有方法产生事务拦截操作 -->
<aop:pointcut id="serviceMethods"
expression="execution(* com.angi.ibatis.service.*.*(..))" />
<!-- 定义了将采用何种拦截操作,这里引用到 txAdvice -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethods" />
</aop:config>
<!-- 需要引入tx的命名空间 -->
<!-- 这是事务通知操作,使用的事务管理器引用自 transactionManager -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 指定哪些方法需要加入事务,这里懒惰一下全部加入,可以使用通配符来只加入需要的方法 -->
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
</beans>
复制代码
4、anotation
复制代码
<?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:p="http://www.springframework.org/schema/p"
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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- 需要引入tx的命名空间 -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<!--<property name="defaultAutoCommit" value="false"/>-->
<property name="url">
<value>jdbc:mysql://localhost/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>mysql</value>
</property>
</bean>
<!-- Spring iBatis Template -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="userDAO" class="com.angi.ibatis.dao.UserDaoImpl">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>
<bean id="userService" class="com.angi.ibatis.service.UserService">
<property name="userDao">
<ref bean="userDAO" />
</property>
</bean>
</beans>
复制代码
Java代码:
复制代码
@Transactional
public void doTransaction() {
User user = new User();
user.setName("11111");
user.setSex(1);
userDao.saveUser(user);
User user1 = new User();
user1.setName("Angikkk");
user1.setSex(1);
userDao.saveUser(user1);
复制代码
}
分类: iBatis, Spring
绿色通道: 好文要顶 关注我 收藏该文与我联系
Angi
关注 - 0
粉丝 - 5
+加关注
2 0
(请您对文章做出评价)
» 下一篇:Java安全领域组成部分
posted on 2011-04-07 10:28 Angi 阅读(8142) 评论(0) 编辑 收藏
刷新评论刷新页面返回顶部
(评论功能已被禁用)
博客园首页博问新闻闪存程序员招聘知识库
最新IT新闻:
· 微信群升级:人数允许超100人 需开通微信支付
· 苹果挖豪雅销售总监 为推出iWatch进行准备
· 我们反对无趣!来游戏化吧
· Linux 3.14将是下一个长期支持内核
· 研究发现人类不喜欢独自思考
» 更多新闻...
最新知识库文章:
· 程序员的自我修养(2)——计算机网络
· 你是否中了工程师文化的毒?
· 不安分的工程师
· 流量劫持——浮层登录框的隐患
· Amazon前技术副总裁解剖完美技术面试
» 更多知识库文章...
Powered by:
博客园
Copyright © Angi
导航
管理
搜索
随笔分类
《Java加密与解密的艺术》读书笔记(10)
文章分类
Agile(1)
Android(3)
Architecture(2)
CSS(3)
Database(5)
DB2(19)
Eclipse(9)
Flash(1)
FreeMarker(2)
Hibernate(2)
iBatis(2)
Java EE(10)
Java SE(22)
JavaScript(7)
JBoss(2)
jQuery(3)
LDAP(1)
Linux(5)
Maven(7)
Microsoft(2)
Oracle(1)
POI(1)
Security(15)
Spring(3)
Spring Batch(2)
Spring Batch Admin(4)
Spring Security(7)
SSO(2)
Struts1(2)
Struts2(1)
Tomcat(7)
Web(7)
发表评论
-
Java身份证验证方法
2015-11-25 11:14 574Java身份证验证方法 package com.tg.user ... -
java 中文乱码问题
2015-06-30 22:19 424JAVA之编码---->CSV在文 ... -
java如何将错误的堆栈信息写入日志
2015-04-13 15:03 1186最近在写代码的时候,在写日志的时候用e.getMessage( ... -
JAVA中去掉空格
2015-03-27 09:42 523JAVA中去掉空格 1. String.trim ... -
gucie注入学习
2015-01-24 19:36 388http://www.blogjava.net/xylz/ar ... -
Spring的AOP配置
2015-01-21 22:35 356Spring的AOP配置 1.先写一个普通类: packa ... -
记住用户名的,选中复选框则记住用户名和密码,下次登录的时候就方便用户名的登陆
2015-01-17 21:51 807记住用户名的,选中复选框则记住用户名和密码,下次登录的时候就方 ... -
mybatis if 字符串比较注意
2014-12-22 14:39 806正确的写法: <if test='finished= ... -
maven搭建springmvc+spring+mybatis实例
2014-11-30 10:17 872maven管理的springmvc+spring+mybat ... -
log4j教程
2014-10-30 10:35 259log4j教程 1. 简介 2. 安装 3. log4j基本 ... -
通过Jersey客户端API调用REST风格的Web服务
2014-10-22 10:12 800通过Jersey客户端API调用REST风格的Web服务 J ... -
redis
2014-09-27 20:25 345java对redis的基本操作 一 ... -
pring + hibernate+ C3P0+MYSQL
2014-08-14 23:49 3441) applicationContext.xml --- ... -
Spring+Quartz实现定时任务的配置方法
2014-06-11 22:01 519Spring+Quartz实现定时任务的配置方法 1、Sch ... -
BigDecimal.setScale 处理java小数点位数 (BigDecimal、精度、位数)
2014-05-10 13:34 1463BigDecimal.setScale 处理java小数点位数 ... -
JAVA实现SFTP的实例:
2014-05-05 11:44 367最近写的一个JAVA实现SFTP的实例: /* * Crea ... -
Java模拟HTTP的Get和Post请求
2014-04-18 16:52 639import java.io.BufferedReader; ... -
Java发送http请求 (get 与 post方法请求)
2014-04-18 16:38 378java发送http请求 (get 与 post方法请求 ... -
Java 使用 URLConnection 模拟 Http Get和Post 提交
2014-04-18 16:27 6461、URLConnectionHelper ... -
HttpClient4使用
2014-03-24 16:11 352package main;import java.i ...
相关推荐
spring事物代码片段,包含了定义输入传播性,和参与事物的类
spring事物的隔离级别,spring对于事物的操作隔离级别分为文档中的几种
spring事物的代码案例。spring事物的代码案例。spring事物的代码案例。
spring事物管理配置的5种方式 前段时间对Spring的事务配置做了比较深入的研究,在此之间对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识。通过这次的学习发觉Spring的事务配置只要把思路理清,还是...
spring 事物底层原理分析1
上文理解到对spring事物,事物的隔离机制,这片具体说下事物的传播机制和隔离机制
spring事物的五种配制方法
对于spring事物的简单理解,对面试或许有帮助,也是加深自己的记忆
spring的2个数据源的配置,并且每个数据源都配置了事物管理。还有rabbitMQ的发送端代码。本人项目亲自用到的,可以运行。
spring 事物管理
spring 事物机制
Spring 配置文件中关于事务配置的五种常用方法,不多说,你懂的
纯属个人网上收集资料, 自认为多spring事物说得很全面
Spring 事务配置的五种方式 ,讲述了Sping 事物配置的全过程
资源太大,传百度网盘了,链接在附件中,有需要的同学自取。
NULL 博文链接:https://zhouchaofei2010.iteye.com/blog/2397918
Spring事务管理Demo
NULL 博文链接:https://fangguanhong.iteye.com/blog/2199913
Spring在TransactionDefinition接口中规定了7种类型的事务传播行为,它们规定了事务方法和事务方法发生嵌套调用时事务如何进行传播 PROPAGATION_REQUIRED PROPAGATION_SUPPORTS PROPAGATION_MANDATORY PROPAGATION_...
spring的5中事物配置 介绍spring的5中事物配置