atomikos

Is it possible to set up parallel transactions in JTA (Atomikos)

旧城冷巷雨未停 提交于 2019-12-08 07:02:32
问题 I have two transactional resources, database and message queue. So I use Atomikos as the XA transaction manager. Inside a transaction (tx1), is it possible to open another separated transaction (tx2) in parallel? In tx2, it will commit some data into db, even the tx1 might be failed and roll backed eventually. And tx2 must be done inside tx1, as if error occurred in tx2 should roll back the tx1 also. Anyone knows how I can achieve this? Thank you. 回答1: Yes, you can achive this. You talk about

resume for XID raised 0: unknown

淺唱寂寞╮ 提交于 2019-12-08 04:57:45
问题 I am using Spring 3.0.5, Hibernate 3.6.7, Atomikos TransactionEssentials 3.7.0 and MySQL 5.5 I recently faced the problem, that connections in my connectionpool timedout after 8 hours and were reset by the server causing a message "resume for XID '???' raised 0: unknown Here is my datasource configuration: <bean id="myDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close" depends-on="myConfigurer"> <property name="uniqueResourceName" value=

Is it possible to set up parallel transactions in JTA (Atomikos)

空扰寡人 提交于 2019-12-06 15:44:25
I have two transactional resources, database and message queue. So I use Atomikos as the XA transaction manager. Inside a transaction (tx1), is it possible to open another separated transaction (tx2) in parallel? In tx2, it will commit some data into db, even the tx1 might be failed and roll backed eventually. And tx2 must be done inside tx1, as if error occurred in tx2 should roll back the tx1 also. Anyone knows how I can achieve this? Thank you. Yes, you can achive this. You talk about so named "nested" transaction First of all for Atomikis you must specify property com.atomikos.icatch

spring boot atomikos multiple datasource connection pool exhausted plain jdbc

本秂侑毒 提交于 2019-12-06 14:44:33
I have a Spring Boot application that uses Atomikos for JTA Managed Transactions. It uses multiple DataSources to connect multiple Databases. The first request returns the expected Result but the second request failes with a 'Pool exhausted' Exception. I tried it with plain JDBC and JdbcTemplate with no result. It is the same. Here is my code with Spring Boot Version 1.5.8.RELEASE @SpringBootApplication @EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, //if you are using Hibernate DataSourceTransactionManagerAutoConfiguration.class })

Differences between javax.jms.ConnectionFactory and javax.jms.XAConnectionFactory

跟風遠走 提交于 2019-12-06 13:57:28
I'm entering the world of JTA, due to need of distributed transactions, and I'm uncertain about the differences between javax.jms.ConnectionFactory and javax.jms.XAConnectionFactory or more accurately how can it be that javax.jms.ConnectionFactory performed what I expected only javax.jms.XAConnectionFactory can do for me. The details: I'm using Atomikos essentials as my transaction manager and my app is running on Apache Tomcat 6. I'm running a small POC with a dummy app where I have my JMS provider ( OpenMQ ) registered as a JNDI resource. <Resource name="jms/myConnectionFactory" auth=

Two-phase commit (2PC) configuration with Atomikos

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 22:44:53
I am creating a sample application to test two-phase commit (2PC). I have taken the code bits used here from the Internet. I am using Spring, Hibernate and Atomikos with MySQL as the backend. I am using two databases and deliberately making the call to the second database fail to check whether the first database call gets rolled back. Sadly it doesn't seem to work. Can some one point me to some links with some sample code? Following is my configuration: The Hibernate session factories: <bean id="sessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name

solve error : log already in use with atomikos with multiple instances

坚强是说给别人听的谎言 提交于 2019-12-05 07:40:36
I am facing an issue only on live server with atomikos, on my local server it works perfectly. the issue i am facng on the server is Error in init(): Log already in use? complete exception stack trace java.lang.RuntimeException: Log already in use? at com.atomikos.icatch.standalone.UserTransactionServiceImp.createDefault(UserTransactionServiceImp.java:205) at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:265) at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:405) at com.atomikos.icatch.jta

How to move location of Atomikos's tm.out and *.epoch files?

江枫思渺然 提交于 2019-12-04 04:45:08
I'm running a J2SE application that uses Atomikos which dumps it's numerous log files to the current directory. I'd like to move the location of these files to "/tmp", but I cannot locate a configuration property that I can set from within my Spring XML config file. The Atomikos documentation references a property: com.atomikos.icatch.output_dir Which seems exactly what I need, but how to set from Spring it without a jta.properties file? Here is my transaction manager config: <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name=

Spring/JTA/JPA DAO integration test doesn't rollback?

天涯浪子 提交于 2019-12-04 03:57:13
问题 My DAO integration tests are failing because entities created during the tests are still in the database at the start of the next test. The exact same behavior is seen from both MySQL 5 and H2. The test classes are annotated with: @Transactional @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( { "/testPersist-applicationContext.xml" }) The transaction bean configuration in the test application context is as follows: <tx:annotation-driven /> <bean id="transactionManager" class=

Java: XA Transaction propagation within many threads

不打扰是莪最后的温柔 提交于 2019-12-03 13:49:14
问题 How can I use a transaction manager (such as Bitronix, JBoss TS or Atomikos) in a Java SE (not Java EE or Spring) to support the following use case: Let's assume we have the following class: public class Dao { public void updateDatabase(DB db) { connet to db run a sql } } and we create a Java Runnable from that, like the following: public class MyRunnable extends Runnable { Dao dao; DB db; public MyRunnable(Dao dao, DB db) { this.dao=dao; this.db = db; } public run() throws Exception { return