Configuring Local and JTA Transaction in Spring based Appplication using JPA

Solution Unverified - Updated -

Issue

  • Spring based applications using JPA having web service which uses 2 datasources which don't require JTA since there is no distributed transaction across the 2 databases.
    The transactions are local to each of the databases. By using JPA for persistence and persistence.xml has non-jta datasource configured and transaction_type is set to local.
    When configured this way, persistence doesn't happen. Only after switching to a JTA transaction manager and using JTA datasource in persistence.xml, the persistence does happen. Persistence.xml files contain one for each of the 2 datasources. Explain why and how supposed to be configured?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content