OpenEJB
  1. OpenEJB
  2. OPENEJB-1109

Deploy time java.sql.SQLException: Auto-commit can not be set while enrolled in a transaction

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.1, 3.1.1, 3.1.2
    • Fix Version/s: 3.1.3
    • Component/s: deployment
    • Labels:
      None

      Description

      The DeployerEjb started a transaction as a side effect of it being an EJB. This led to oddities as the entire deploy process for that archive would execute in transaction. At deployment JPA PersistenceProviders will initialize and @Singleton beans may start. These should not be running in a transaction unless they themselves wish to start one.

      One particular reported issue involves Hibernate not being able to execute it's DDL updating logic (hibernate.hbm2ddl.auto) when the app is deployed. The resulting exception in this case is a deploy time exception like the following:

      java.sql.SQLException: Auto-commit can not be set while enrolled in a transaction

      Note, putting the application in the apps/ directory manually and restarting the server is one way to work around this issue in existing releases of OpenEJB.

        Activity

        Hide
        David Blevins added a comment -

        Bean in question now uses Bean-Managed Transactions

        Show
        David Blevins added a comment - Bean in question now uses Bean-Managed Transactions

          People

          • Assignee:
            David Blevins
            Reporter:
            David Blevins
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development