Questions tagged [transactionmanager]

A transaction manager is the part of an application that is responsible for coordinating transactions across one or more resources.

A transaction manager is the part of an application that is responsible for coordinating transactions across one or more resources. The concept of transaction manager is common to many persistence frameworks.

See:

164 questions
74
votes
2 answers

Spring - Is it possible to use multiple transaction managers in the same application?

I'm new to Spring and I'm wondering if its possible to use numerous transaction managers in the same application? I have two data access layers - one for both of the databases. I'm wondering, how do you go about using one transaction managers for…
Brian DiCasa
  • 9,369
  • 18
  • 65
  • 97
39
votes
4 answers

Spring @Transactional with a transaction across multiple data sources

I have to update two data sources as part of one transaction. That is - I do an update in DB1. Then, I do another update in DB2. If update in DB2 fails, I want to roll back both DB1 and DB2 to roll back. Can this be accomplished using…
25
votes
5 answers

What is a good open source Java SE JTA TransactionManager implementation?

Basically, what it says on the tin; I need a JTA implementation useable in a Java SE application, ideally one that doesn't carry too much of a framework burden with it.
Chris R
  • 17,546
  • 23
  • 105
  • 172
15
votes
2 answers

Is there a way to define a default transaction manager in Spring

I have an existing application that uses the Hibernate SessionFactory for one database. We are adding another database for doing analytics. The transactions will never cross so I don't need JTA, but I do want to use JPA EntityManager for the new…
Josh
  • 2,842
  • 8
  • 45
  • 51
13
votes
2 answers

How do you test Spring @Transactional without just hitting hibernate level 1 cache or doing manual session flush?

Using Spring + Hibernate and transactional annotations. I'm trying to test the following: call a method that changes a User object then calls a @Transactional service method to persist it read the object back from the DB and insure it's values are…
13
votes
6 answers

Working with Spring Data JPA, Hibernate and multiple transaction manager: No bean named 'transactionManager' is defined

EDIT: to whoever may be in interested in this issue, I provide the analysys of the problem with the related solution at the end of the question. I am configuring a module for a web application in which I am using Spring 3.2, Hibernate 4.1, Spring…
12
votes
1 answer

Does the Spring transaction manager bind a connection to a thread?

I found the following thread: How exactly JdbcTemplate with TransactionManager works together? The first sentence of that: As far as I understood DataSourceTransactionManager binds a JDBC connection from the specified DataSource to the current…
dnc253
  • 39,967
  • 41
  • 141
  • 157
11
votes
2 answers

UPDATE statement on table xxx' expected to update 1 row(s); 0 were matched with Zope transactionmanager

I am running a Pyramid + Zope transaction manager + SQLAlchemy + PostgreSQL. On some occasions, I have seen StaleDataError error on a Pyramid web application which should very trivial view of updating one row in a database. As the error happens…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
9
votes
1 answer

Why is HIbernateTransactionManager required in Spring?

When we can do transactions in hibernate through session, what is the need of HibernateTransactionManager again in Spring-hibernate integration? What is the role of it? Why can't we do transactions directly without this?
ramu p
  • 116
  • 1
  • 1
  • 3
9
votes
3 answers

Spring TransactionManager - commit does not work

I am trying to create Spring-based solution for running batch of SQL queries on MySQL 5.5 server. By "query" I mean any SQL statement that compiles, so the SQL batch job can contain for example several CREATE TABLE, DELETE and then INSERT…
aviad
  • 8,229
  • 9
  • 50
  • 98
8
votes
2 answers

TransactionManagementType.CONTAINER vs TransactionManagementType.BEAN

what is the difference between TransactionManagementType.CONTAINER and TransactionManagementType.BEAN as Im using TransactionManagementType.CONTAINER in all of my EJBs and when ever the multiple instances of database is used, It throws an error…
7
votes
1 answer

JDBCTemplate with TransactionTemplate and Connection Pool, which datasource to use

I'm not quite sure how to formulate the question, so feel free to tell me that I am thinking completly wrong. I want to use the JdbcTemplate and the TransactionTemplate. I start of by initilizing my connection pool as datasource and the create a…
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
6
votes
0 answers

Transactions with Guice and JDBC - Solution discussion

In my application, I need to use pure JDBC together with Guice. However, Guice doesn't provide any built-in support to manage transactions. guice-persist only provides support based on JPA, which I cannot use. so I tried to implement a simple…
honghai
  • 83
  • 1
  • 5
6
votes
5 answers

TransactionManager cannot initialize

NEW CONF: i made some change to match with what you are saying. now i deleted hibernate-cfg.xml and did all conf in spring-servlet.xml :
MinionKing
  • 187
  • 1
  • 4
  • 20
5
votes
1 answer

what is the difference between DataSourceTransactionManager and ResourcelessTransactionManager?

What is the difference between org.springframework.jdbc.datasource.DataSourceTransactionManager and org.springframework.batch.support.transaction.ResourcelessTransactionManager
1
2 3
10 11