BTM
  1. BTM
  2. BTM-125

corrupt LrcXAResource on deferred constraint violation

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.3
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Environment:
      PostgreSQL. Derby does not support deferred constraints.
    • Testcase included:
      yes
    • Number of attachments :
      3

      Description

      When using LrcXADataSource in combination with PoolingDataSource a deferred constraint violation at commit-time causes the associated connection to become corrupt. Whenever this connection is used in subsequent transactions these transactions fail with a "resource already registered XID" exception.

      The cause for this seems to be that the LrcXAResource of the connection remains in state ENDED when commit() fails because of an exception from the wrapped connection.

      I don't know if it is appropriate to change the resource state to NO_TX in this case. If it isn't then at least the corrupt connection should be replaced in the pool.

      1. corrupted-exception.txt
        5 kB
        Patrick Kelchner
      2. DeferredConstraintViolationTest.java
        4 kB
        Patrick Kelchner
      3. root-cause-exception.txt
        5 kB
        Patrick Kelchner

        Activity

        Hide
        Patrick Kelchner added a comment -

        Sorry for the german error message in root-cause-exception.txt. It roughly reads "foreign key constraint violated. The referenced key does not exist."

        Show
        Patrick Kelchner added a comment - Sorry for the german error message in root-cause-exception.txt. It roughly reads "foreign key constraint violated. The referenced key does not exist."

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Patrick Kelchner
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: