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
13
votes
4 answers

How to manage transaction for database and file system in Java EE environment?

I store file’s attributes (size, update time…) in database. So the problem is how to manage transaction for database and file. In a Java EE environment, JTA is just able to manage database transaction. In case, updating database is successful but…
卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130
13
votes
2 answers

Spring JTA configuration - how to set TransactionManager?

We configure our Spring transaction in Spring config as: I gather this means that Spring will automatically discover the underlying JTA implementation. So when we start up JBoss we see these messages while Spring…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
13
votes
1 answer

Cannot inject RESOURCE_LOCAL container managed EntityManager using @PersistenceContext

I am using JBoss AS 7.1.1 and able to configure a new JTA datasource and wire it to my EJB using @PersistenceContext(unitName="TestPU") private EntityManager entityManager; When I tried to use RESOURCE_LOCAL PersistenceUnit I am getting the error…
K. Siva Prasad Reddy
  • 11,786
  • 12
  • 68
  • 95
12
votes
2 answers

Why is hibernate.connection.release_mode after_transaction not recommended for JTA?

While analyzing some performance problems in Wildfly 10.1 in high pressure scenarios I came to the conclusion, that sometimes parallel HTTP threads block each other. The reason seemed to be that in some HTTP requests we execute two JPQL Queries…
Martin Rauscher
  • 1,700
  • 1
  • 14
  • 20
12
votes
7 answers

Strange Atomikos exception - Error in init(): Log already in use?

We're trying to run the same web application that uses Atomikos as transaction manager on several local envrionments (each of those uses the same versions of spring, atomikos, tomact etc with the same configuration files). Some of them work fine,…
Ayelet
  • 1,713
  • 9
  • 29
  • 43
11
votes
1 answer

Can you use a Hibernate 5.2 StatelessSession in an OSGi environment (like Karaf) without the use of JTA?

I'm trying to use a StatelessSession to do some bulk inserts in an OSGi environment (Karaf 4.0.7), but when I try to commit my transaction I get be.ikan.lib.orm.base.exceptions.PersistenceBrokerException: org.hibernate.TransactionException: Cannot…
Frank S
  • 121
  • 5
11
votes
3 answers

Using Spring defined transactionManager in JPA/Hibernate

Suppose you use JPA with Spring, with Hibernate as JPA implementation. JPA transaction mode is "JTA", so you need to pass the container transactionManager to Hibernate. The classical answer is to set hibernate.transaction.manager_lookup_class to the…
mleduque
  • 198
  • 1
  • 1
  • 9
11
votes
5 answers

How to use Atomikos Transaction Essentials with Hibernate >= 4.3

I switched from Hibernate 4.2 to Hibernate 4.3 and my project is not working any more. I'm getting an HibernateException: Unable to locate current JTA transaction when I do Session s = sessionFactory.getCurrentSession(); I've realized that…
sebplorenz
  • 999
  • 2
  • 10
  • 17
11
votes
1 answer

persistence.xml for multiple persistence units

I'm trying to persist the same entity to both MySQL and Postgres databases (this is primarily to identify any inconsistencies, and work out the details of any issues doing the dual-write -- which I've run into here). The articles I've found have…
CraftWeaver
  • 707
  • 1
  • 8
  • 21
11
votes
2 answers

Best way to handle JPA merge?

I'm new to the whole JPA thing so I have multiple questions about the best way to handle JPA merge and persist. I have an user object which should be updated (some values like date and name). Do I have to merge the passed object first or is it…
ManuPanu
  • 217
  • 1
  • 3
  • 12
11
votes
3 answers

Why nested transactions are not supported in JTA

Why aren't nested transactions supported by JTA? Is it because of the complexity of implementing them (which I doubt) or some design principle?
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
10
votes
2 answers

Spring Batch Reader's cursor closed early in JTA transaction managed step

The working configuration for the step in question is the following: Step, Spring Batch Job Repository, and business repositories (using various datasources) all use a JTA transaction manager. Step "myStep" uses a Jdbc Paging Item Reader. WebLogic,…
DBK
  • 421
  • 3
  • 12
10
votes
1 answer

Spring Transactions - Prevent rollback after unchecked exceptions (RuntimeException)

I can't manage to prevent a transaction from rolling back after a RuntimeException. My env is Spring 4.1 + Hibernate 3.6 + JTA (WebSphereUowTransactionManager) running on Websphere 8.0. "doStuff" case: works First off, a simple case that behaves as…
codependent
  • 23,193
  • 31
  • 166
  • 308
10
votes
5 answers

Spring JTA TransactionManager config: Supporting both Tomcat and JBoss

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…
Henning
  • 16,063
  • 3
  • 51
  • 65
10
votes
1 answer

Difference between JTA and Spring @Transactional annotations

I've been starting to use Spring's @Transactional annotation, and it provides a lot of convenience for managing transactions. However, using this annotation in our code now makes us dependent on Spring. I know with JPA type stuff there is a javax…
dnc253
  • 39,967
  • 41
  • 141
  • 157
1 2
3
75 76