Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-3258

JTA & BundleDbPersistenceManager in autocommit mode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Not a Problem
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: jackrabbit-core
    • Labels:
      None
    • Environment:
      Postgresql 8.4
      BTM 2.1.2
      Jencks 2.0

      Description

      Neither JTA nor JCA with JTA works because of the exception 'java.sql.SQLException: autocommit is not allowed on a resource enlisted in a global transaction' from BTM,
      issue JCR-1253 has explanation of why keep autocommit enabled, but there is always error when autocommit mode is true.

      1. non-jca.log
        20 kB
        YP
      2. jca.log
        54 kB
        YP

        Activity

        Hide
        Carl Pritchett added a comment -

        We get the same issue - the BundleDBPersistenceManager uses the ConnectionHelper via getConnection() and this always sets autoCommit to true. I'm using a Spring transaction - and this causes a similar error to the error in the description.

        org.apache.jackrabbit.core.state.ItemStateException: failed to read bundle: fa395a84-99e0-46c1-8d89-ff62c3f6c4d9: java.sql.SQLException: You cannot set autocommit during a managed transaction!

        When can use "NOT_SUPPORTED" but I'd prefer not to for obvious reasons.

        Perhaps there is a way to use XASessions to do this and I'd love a link to the doco on how, but can we turn off autoCommit via an option when not running in a cluster?

        Show
        Carl Pritchett added a comment - We get the same issue - the BundleDBPersistenceManager uses the ConnectionHelper via getConnection() and this always sets autoCommit to true. I'm using a Spring transaction - and this causes a similar error to the error in the description. org.apache.jackrabbit.core.state.ItemStateException: failed to read bundle: fa395a84-99e0-46c1-8d89-ff62c3f6c4d9: java.sql.SQLException: You cannot set autocommit during a managed transaction! When can use "NOT_SUPPORTED" but I'd prefer not to for obvious reasons. Perhaps there is a way to use XASessions to do this and I'd love a link to the doco on how, but can we turn off autoCommit via an option when not running in a cluster?
        Hide
        Chris Poulsen added a comment -

        I see a variant of the same issue when using jcr from an ejb. On jboss as 5.1, jackrabbit 2.4.3 (jca connector).

        Show
        Chris Poulsen added a comment - I see a variant of the same issue when using jcr from an ejb. On jboss as 5.1, jackrabbit 2.4.3 (jca connector).
        Hide
        Jukka Zitting added a comment -

        Jackrabbit is designed to work directly as an XA resource, which means that the underlying database should not be controlled by a transaction manager. Instead, to properly implement transaction semantics, Jackrabbit needs to be in control of the underlying database connection.

        Show
        Jukka Zitting added a comment - Jackrabbit is designed to work directly as an XA resource, which means that the underlying database should not be controlled by a transaction manager. Instead, to properly implement transaction semantics, Jackrabbit needs to be in control of the underlying database connection.
        Hide
        Carl Pritchett added a comment -

        That's fine - but can we turn auto commit off somehow? There is not access to autocommit.

        Show
        Carl Pritchett added a comment - That's fine - but can we turn auto commit off somehow? There is not access to autocommit.
        Hide
        Jukka Zitting added a comment -

        We need autocommit since Jackrabbit is using long-lived database connections. Without autocommit we'd have to add an explicit COMMIT statement even after each SELECT query as otherwise databases with high transaction isolation levels would have to keep a transaction open potentially indefinitely.

        Show
        Jukka Zitting added a comment - We need autocommit since Jackrabbit is using long-lived database connections. Without autocommit we'd have to add an explicit COMMIT statement even after each SELECT query as otherwise databases with high transaction isolation levels would have to keep a transaction open potentially indefinitely.

          People

          • Assignee:
            Unassigned
            Reporter:
            YP
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development