jotm

when to use global transaction Or use spring aop for transaction

最后都变了- 提交于 2019-12-21 05:40:09
问题 Q1. i do understand when we need to deal with multiple databases, we need to use global transaction. but from this post http://fogbugz.atomikos.com/default.asp . the person suggested just use spring aop to advise on the different transactionmanager ( more > datasource/sessionfactory). can anyone explain in what kind of situation we can just use this approach And In what kind of situation do we need XA (global transaction) with atomikos or jotm or ejb..etc 回答1: If you are referring to this

Spring JTA TransactionManager config: Supporting both Tomcat and JBoss

折月煮酒 提交于 2019-12-04 08:47:35
问题 I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have both scenarios working, but I now find that I seem to need two separate Spring configurations for the two cases. With JOTM, I need to use Spring's JotmFactoryBean : <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">

Spring JTA TransactionManager config: Supporting both Tomcat and JBoss

我们两清 提交于 2019-12-02 23:53:15
I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have both scenarios working, but I now find that I seem to need two separate Spring configurations for the two cases. With JOTM, I need to use Spring's JotmFactoryBean : <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransaction"> <bean class="org.springframework.transaction.jta.JotmFactoryBean"/> <

分布式事务系列(3.1)jotm的分布式案例

拥有回忆 提交于 2019-11-27 07:13:22
#1 系列目录 分布式事务系列(开篇)提出疑问和研究过程 分布式事务系列(1.1)Spring事务管理器PlatformTransactionManager源码分析 分布式事务系列(1.2)Spring事务体系 分布式事务系列(2.1)分布式事务模型与接口定义 分布式事务系列(3.1)jotm的分布式案例 分布式事务系列(3.2)jotm分布式事务源码分析 分布式事务系列(4.1)Atomikos的分布式案例 #2 与Spring集成方式使用jotm 工程代码地址: 与Spring集成方式使用jotm 先来感受下一个分布式事务的案例(使用一般的数据库驱动,不需要支持分布式XA协议): ##2.1 业务逻辑的操作 UserDao和LogDao,操作分别如下: @Repository public class UserDao { @Resource(name="jdbcTemplateA") private JdbcTemplate jdbcTemplate; public void save(User user){ jdbcTemplate.update("insert into user(name,age) values(?,?)",user.getName(),user.getAge()); } } @Repository public class LogDao {

spring transactional cpool. Which one do I use?

痞子三分冷 提交于 2019-11-27 06:24:47
问题 I originally set up spring with xapool, but it turns out that's a dead project and seems to have lots of problems. I switched to c3p0, but now I learn that the @Transactional annotations don't actually create transactions when used with c3p0. If I do the following it will insert the row into Foo even through an exception was thrown inside the method: @Service public class FooTst { @PersistenceContext(unitName="accessControlDb") private EntityManager em; @Transactional public void insertFoo()

分布式事务系列(开篇)提出疑问和研究过程

我们两清 提交于 2019-11-26 19:26:22
#1 前言 系列目录 分布式事务系列(开篇)提出疑问和研究过程 分布式事务系列(1.1)Spring事务管理器PlatformTransactionManager源码分析 分布式事务系列(1.2)Spring事务体系 分布式事务系列(2.1)分布式事务模型与接口定义 分布式事务系列(3.1)jotm的分布式案例 分布式事务系列(3.2)jotm分布式事务源码分析 分布式事务系列(4.1)Atomikos的分布式案例 对于我们这种初学者,可能会使用spring带给我们的@Transactional,可能了解JTA,可能会使用jotm、atomikos,又会遇到一些名词XA,支持XA的数据库驱动等等诸多问题,然后就会愈加混乱,自然形成一个疑问,庞大的事务体系的全貌到底是什么样? #2 需要解决的疑惑 下面就要具体列出一系列需要解决的问题 ##2.1 对于事务模型 三种事务模型是什么?各自的特点是什么?各自的缺陷是什么? ##2.2 spring对于事务模型的支持 spring自己的一系列接口设计: PlatformTransactionManager 事务管理器 TransactionDefinition 事务定义 TransactionStatus 事务状态 等等 上述一系列接口的实现是如何对非分布式和分布式事务的支持的呢? ##2.3 针对分布式事务的规范 X/Open