Questions tagged [jta]

Java Transaction API (JTA) specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.

JTA specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.

1131 questions
9
votes
1 answer

how to share one transaction between multi threads

We meet an scenario that works with multi thread. In the main Thread, do some logic and update the database, in a point, it will call another service to update database, which is run in another Thread. We want the two Threads share the same…
Scarlett
  • 731
  • 8
  • 19
9
votes
1 answer

When to Use XA Datasource and Non XA Datasource

I'm trying to understand the use of Java XA Datasource. But I can't still figure when to use it, and when not to use it. I read that XA Datasource used when we use two databases. But I'm not sure what is the meaning of two database. For example: I…
lazulfikar
  • 91
  • 1
  • 1
  • 2
9
votes
2 answers

javax.persistence.TransactionRequiredException while performing inserts in a loop

I have an application which uses Spring, Hibernate and JTA. We received a request with larger than expected data (10000 elements), general requests are 10-100 elements. While processing this request we try to insert a record in DB for each of these…
user1933888
  • 2,897
  • 3
  • 27
  • 36
9
votes
1 answer

Can I use Hibernate with JTA?

If JTA is an API, can I use Hibernate as an implementation of JTA? I have an application with Spring and Hibernate and I wonder which framework should be responsible for transactions, Spring or Hibernate?
user3528733
  • 1,259
  • 7
  • 20
  • 37
8
votes
5 answers

IllegalArgumentException in class: ..., getter method of property: id

I have two classes Role and Privilege with the relation ManyToMany. When adding a Privilege to a Role, and then calling saveOrUpdate(role), I get the exception below. Here is the Role class: @Entity @Table(name = "ROLES") public class Role…
storm_buster
  • 7,362
  • 18
  • 53
  • 75
8
votes
2 answers

The chosen transaction strategy requires access to the JTA TransactionManager or Unable to build EntityManagerFactory

I am using Spring 2.0.6 and Hibernate 3.2.x on apache tomcat5.5,now we planed to changed our hybernate mapping files into hybernate+jpa support mapping files. for that we created files like this daoConfig.xml
unknown
  • 643
  • 4
  • 15
  • 38
8
votes
1 answer

spring integration test fail to load context "Another resource already exists with name dataSource"

I am using test annotation introduced in spring-boot 1.4.3 for my integration tests @RunWith(SpringRunner.class) @SpringBootTest public class MyServiceIT { } According to documentation, test context is cached and reused to speed up integration…
ltfishie
  • 2,917
  • 6
  • 41
  • 68
8
votes
1 answer

hibernate, mysql, glassfish v3, and JTA datasource

I'm attempting to use hibernate entity manager with mysql and glassfish. I'm getting the following error when attempting to use a JTA datasource: Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the…
KevMo
  • 5,590
  • 13
  • 57
  • 70
8
votes
1 answer

Invoking few queries to different data sources concurrently, using JTA, in scope of one global transaction

I've got an application with 3 distributed dataSources (com.atomikos.jdbc.AtomikosDataSourceBean). I'm using Atomikos transaction manager as JTA implementation. Every dataSource works with PostgreSQL database. Now, I'm invoking my queries…
Vladislav Bauer
  • 952
  • 8
  • 19
8
votes
3 answers

XA/JTA transaction: JMS message arrives before DB changes are visible

Context is: producer (JTA transaction PT) is both sending message to JMS queue and making DB update; consumer (JTA transaction CT) listens on same queue and reads DB when message is received; application server - WebLogic, DB - Oracle. I've…
Ralkie
  • 3,736
  • 3
  • 25
  • 25
7
votes
4 answers

Is there an open-source solution to XA-transactional file access in Java?

Is it possible to make XA-transactional access to the file system in Java? I want to manipulate files within the boundaries of a transaction and my transaction must participate in a distributed transaction via JTA (so I guess the file system needs…
Ori
  • 12,800
  • 4
  • 33
  • 32
7
votes
2 answers

EntityManager.contains() returns false after persist()

The documentation for EntityManager.persist() says it will Make an instance managed and persistent. It is persisting the entity to the database, but when I call the EntityManager.contains() method to check if the entity that I just persisted is…
chip
  • 3,039
  • 5
  • 35
  • 59
7
votes
2 answers

Accessing transaction status in container managed beans

I have a @Stateless EJB using container managed transaction. Is there a way to access the "status" of javax.transaction.UserTransaction? That is, calling UserTransaction.getStatus() inside the bean methods? I know access to UserTransaction is…
Vicky
  • 5,380
  • 18
  • 60
  • 83
7
votes
2 answers

What is the meaning of Transaction?

I've been reading about "Java Transaction" , and i've been confused about what's it? and what's useful in?
MineIsMine
  • 424
  • 2
  • 10
  • 20
7
votes
2 answers

Can I exclude an exported package from a Java module?

Modules jta and java.sql export package javax.transaction.xa to module dom4j As you can see, both modules jta and java.sql export the same package, javax.transaction.xa. However, the package in jta has classes that I require that are not present…
Jacob G.
  • 28,856
  • 5
  • 62
  • 116