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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.