- 浏览: 227198 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (96)
- J2EE (11)
- Spring (11)
- Oracle (3)
- Struts2 (7)
- Hibernate (1)
- Struts1.x (0)
- 职场内外 (1)
- Java (31)
- JSP基础 (3)
- 英语点滴 (1)
- Linux (2)
- JavaScript (12)
- ANT (5)
- 计算机基础知识 (2)
- 开发工具 (4)
- Java网络编程 (3)
- Swing (2)
- JVM (3)
- 网络协议 (3)
- 算法与数据结构 (5)
- Ext JS (1)
- Spring JUnit (1)
- XML (1)
- 搜索引擎 (1)
- NoSQL (1)
- 搜索(引擎) Solr Lucene (2)
- UML (1)
- Design Pattern (1)
最新评论
-
chokee:
struts2如何获取页面参数 -
mengfei86:
顶顶!
jstat的使用方法 -- 分析JVM的使用情况 -
yifzeng:
感谢楼上两位!!!
Struts2 验证框架不起作用的几种可能[转] -
xianqi_h:
如果所要用的形容词是几个,而且是上述所列的归类之外的词,如: ...
英语形容词的排列顺序 -- 重点记忆 -
skzr.org:
fixbug——在IE7下面:IE无法打开站点XXXX,无法操 ...
struts2开发中ie无法打开XXX站点 已终止操作
Spring Transaction Architecture
Deployment options
As shown below, there are two fundamentally different ways of deploying an application that uses Spring transactions:
- Standalone Spring container
- J2EE container deployment
Standalone Spring container
In the standalone deployment model, the Spring container is provides access to persistent data sources and is responsible for managing the transactions associated with those data sources. A notable limitation of the standalone model is that the Spring container can support only local transaction managers, which means that only one data source (resource) at a time can participate in a transaction.
Data source
Spring supports a variety of different wrapper APIs for accessing persistent storage. For example, to access a database through JDBC, Spring provides the SimpleDriverDataSource class to represent the database instance and the JdbcTemplate class to provide access to the database using SQL. Wrappers are also provided for other kinds of persistent resource, such as JMS, Hibernate, and so on. The Spring data sources are designed to be compatible with the local transaction manager classes.
Local transaction manager
In Spring, a local transaction manager is a wrapper class that is responsible for managing the transactions of a single resource. The local transaction manager is responsible for starting, committing, and rolling back transactions. Typically, the way that you use a transaction manager in Apache Camel is that you pass the transaction manager reference to a transactional Apache Camel component bean.
Spring provides different types of local transaction manager for different types of data source. For example, Spring provides a DataSourceTransactionManager for JDBC, a JmsTransactionManager for JMS, a HibernateTransactionManager for Hibernate, and so on.
J2EE container deployment
In the J2EE deployment model, the Spring container is nested inside a J2EE application server. The advantage of this deployment model is that the Spring container can leverage the transaction management capabilities of the J2EE container. In particular, the Spring container can now access global transactions, which means that multiple resources can participate in a single transaction.
XA resources
In a J2EE deployment, the persistent resources should be integrated directly with J2EE. In other words, you do not use Spring data sources in this case. Moreover, in order to enable global transactions, you register each resource's XA interface with the JTA transaction manager in the J2EE environment.
JTA transaction manager
The Java Transaction API (JTA) and the Java Transaction Service define respectively the API and the implementation of a transaction manager for the J2EE platform. A full implementation of the JTA transaction manager can potentially provide enterprise-level transaction features, including support for global transactions, XA resources, and (in some cases) distributed transactions.
Global transaction manager
To access J2EE global transactions from within the Spring environment, the Spring container provides the JtaTransactionManager class, which is essentially just a thin wrapper around the JTA transaction manager. In fact, the JTA transaction manager is completely configured within the J2EE environment. If required, you can instantiate the Spring wrapper class, JtaTransactionManager, by obtaining a reference to the existing JTA transaction manager in J2EE, typically using a JNDI lookup.
For detail, open this url:
发表评论
-
运行mvn eclipse:eclipse 报插件不存在或者版本不对错误
2013-07-26 20:59 1150我的maven版本是2.2.1,当我使用mvn eclip ... -
eclipse 安装velocity插件
2013-07-14 21:09 895安装velocity的eclipse插件步骤: ... -
java日志,需要知道的几件事 -- 转
2013-03-07 14:16 889http://blog.csdn.net/su ... -
构建高可扩Web架构和分布式系统实战 -- 转
2013-01-24 11:34 996http://www.csdn.net/articl ... -
Java中的ReentrantLock和synchronized两种锁定机制的对比 -- 转
2013-01-07 09:45 1170阅读本文,使我从对比的角度重新审视了两种锁的机制。 分享 ... -
ant jsch.jar -- 一个异常及解决方法
2012-12-11 14:49 3426运行build.xml出现异常: Cause: Cou ... -
struts2 拦截器 -- 转
2012-11-20 15:46 844深入认识struts2拦截器(甚至是struts2的ac ... -
web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序 (转)
2012-11-20 14:44 835servlet: 项目的运 ... -
全局事务与本地事务的区别应用
2012-10-15 15:44 1291http://blog.csdn.net/sunitjy ... -
搜索服务器Solr部署使用
2012-09-21 10:56 984本文肤浅探讨MySQL + Solr + Solr ... -
JAVA - DOM4J - XML 转化成String字串
2012-09-07 10:20 5321import org.dom4j.Document; imp ... -
JVM "Out of swap space"错误常见的原因
2012-08-01 15:31 1159Out of swap space error general ... -
struts2 converter 之类型转换器
2012-06-06 14:48 14951. 前面讲的自定义类型转换器是基于 OGNL 的 Defau ... -
Java中static、final用法小结
2012-05-18 14:02 1108一、final 1.final变量: 当 ... -
ConcurrentHashMap 详解
2012-05-15 15:03 0java.util.concurrent.Concurrent ... -
JAVA泛型简析
2012-05-11 15:13 1073泛型是JDK1.5支持的新功 ... -
Ant之build.xml详解
2012-05-08 14:55 1145Ant的概念 可能有些读 ... -
hashcode 与 equals 方法详解 --- 透彻,详尽
2012-01-15 20:41 0如果函数返回类型不同,子类的同名函数不能继承父类的同名函数 ... -
Java Hash算法大全
2012-01-15 20:35 1430/*** Hash算法大全<br>* 推荐使用FN ... -
java中equals和==的区别
2012-01-15 19:03 788<script type="text/ja ...
相关推荐
spring-hibernate-maven-transaction整合
分布式事务演示-distributed-transaction-demo
测试spring事务管理 搭建了ssh框架的web工程 本工程用到的数据库表很简单 user(id, name) 可自行创建 本例所有的事务放在service层进行管理,方法中间抛出运行时异常以测试是否回滚 Spring配置文件中关于事务...
SSI(Struts2 + Spring + IBatis)框架集成。
Spring是什么呢?首先它是一个开源的项目,而且目前非常活跃...它实现了很优雅的MVC,对不同的数据访问技术提供了统一的接口,采用IOC使得可以很容易的实现bean的装配,提供了简洁的AOP并据此实现Transaction Management
org.springframework.transaction-3.0.4.RELEASE.jar org.springframework.web.portlet-3.0.4.RELEASE.jar org.springframework.web.servlet-3.0.4.RELEASE.jar org.springframework.web.struts-3.0.4.RELEASE....
spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是独立的,我列了目录,可以只下载需要的包,这是1号包: 1号包: edu.emory.mathcs.backport edu.oswego.cs....
Spring交易演示spring-transaction-demo spring事务传播机制的7种使用方式
基于Hyperf的TCC分布式事务-tcc-transaction
spring-data-jpa-transaction-test测试spring data jpa 事务如何调用
org.springframework.transaction-3.0.0.M4.jar: 为JDBC、Hibernate、JDO、JPA等提供的一致的声明式和编程式事务管理 org.springframework.web.servlet-3.0.0.M4.jar: SpringMVC org.springframework.jms-3.0.0.M4...
spring-multi-transaction
spring-jpa-transaction
spring-framework-3.1.2.RELEASE.zip
Spring Boot Documentation 1. About the Documentation 2. Getting Help 3. First Steps 4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics II. ...
分布式简易事务回滚框架:biz-center-base-transaction
spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是独立的,我列了目录, 可以只下载需要的包,这是5号包: 1号包: edu.emory.mathcs.backport edu.oswego....
org.springframework.transaction-3.1.RELEASE.jar org.springframework.web.portlet-3.1.RELEASE.jar org.springframework.web.servlet-3.1.RELEASE.jar org.springframework.web.struts-3.1.RELEASE.jar org....
org.springframework.transaction-3.2.2.RELEASE最新版本
spring-tx spring-transaction spring事务管理实例