This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

spring transactions strategy for component integration

Lets say A and B. A is JMS application that picks up message from queue and does some business rules processing. A uses B for database persistence. B does all database operations.

So, that means B's methods are called from A always. A is developed using WebsphereUowTransactionManager (server specific subclass of JtaTransactionManager) while B is using JpaTransactionManager. A uses programmatic transaction model (yes, we need it) while B uses declarative model (@Transaction annotation). Both were developed using separate bean configurations.

Now, in integration, we are facing transaction exceptions. I believe it is due to mis-match between transaction models of A and B. Theoritcally, B will use A's transactional context which is programatic. This makes B's declarative model redundant.

So, the question is what should be the correct combined transaction strategy to integrate A and B?

My understanding - A uses programmatic transactions so B also must use programmatic model.