Geronimo
  1. Geronimo
  2. GERONIMO-5824

jpa JTA transaction and missing jta-data-source should be warned about or rejected

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.8, 2.2.2, 3.0.0
    • Fix Version/s: None
    • Component/s: persistence
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Someone just had a lot of weird transaction errors that turned out to be because they had configured a persistence.xml with JTA transaction support and only a non-jta-datasource that was actually transactional. When both the tm and openjpa tried to control the tx confusion enused.

      We can detect this situation on deployment and either reject it or at least loudly warn about it.

        Activity

        Hide
        David Jencks added a comment -

        Thanks for looking into this.

        in the persistence.xml you can specify <jta-datasource> and <non-jta-datasource>. In this case only the <non-jta-datasource> was specified. However, the datasource configured there should have had

        <no-transaction/> in its plan but had either

        <local-transaction/>
        or
        <xa-transaction/>

        Openjpa uses the non-jta-datasource for things like creating tables, getting "sequence" values from tables outside a jta transaction, and similar things. It uses the connection.commit style of local transaction management which causes exceptions if the connection is already enrolled in an XA transaction since it's from a transactional datasource.

        If this is not enough information let me know.

        Show
        David Jencks added a comment - Thanks for looking into this. in the persistence.xml you can specify <jta-datasource> and <non-jta-datasource>. In this case only the <non-jta-datasource> was specified. However, the datasource configured there should have had <no-transaction/> in its plan but had either <local-transaction/> or <xa-transaction/> Openjpa uses the non-jta-datasource for things like creating tables, getting "sequence" values from tables outside a jta transaction, and similar things. It uses the connection.commit style of local transaction management which causes exceptions if the connection is already enrolled in an XA transaction since it's from a transactional datasource. If this is not enough information let me know.
        Hide
        xiezhi added a comment -

        Hi,David.Could you get an sample about the issue. I couldn't understand How the configuration mistake happened.

        Show
        xiezhi added a comment - Hi,David.Could you get an sample about the issue. I couldn't understand How the configuration mistake happened.

          People

          • Assignee:
            Unassigned
            Reporter:
            David Jencks
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development