cloudnaut
cloudnaut

Reputation: 982

spring multiple @transactional datasource

I need to use two different dataSources/transactionManagers for different methods. The concept with @Transaction(value="txManagerABC") and a defined qualifier in the applicationContext for the transaction manager is perfect. (As seen in Spring multiple @Transactional datasources)

Unfortunately I need to do the same thing with Spring 2.5. Does anyone have an idea how to solve this?

Upvotes: 0

Views: 1608

Answers (2)

Mouna Cheikhna
Mouna Cheikhna

Reputation: 39678

The problem is, the Transactional annotation does not let you specify a transaction manager , and one transaction manager can only manage one DataSource. but There's a way to do so by using JTA and JTOM , see how you can do it here

Upvotes: 0

Ryan Stewart
Ryan Stewart

Reputation: 128949

I believe the recommended way would be to fall back to XML transaction aspect configuration. If you really want annotations, you could probably make some modifications to the @Transactional annotation and surrounding infrastructure to make it work. Or you could update to Spring 3. There is very little to no compatibility issue between 2.5 and 3.

Upvotes: 1

Related Questions