Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-17772

client code should not set autocommit mode at all

    XMLWordPrintable

    Details

      Description

      As we're running by default managed, code such like SQL directory shouldn't manage itself the commit mode but should delegate it to the connection helper. In connection helper, we could test the mode regarding the transaction status and correct it if needed.

      org.nuxeo.ecm.directory.DirectoryException: Cannot connect to SQL directory 'WSEInitFile': Auto-commit can not be set while enrolled in a transaction
              at org.nuxeo.ecm.directory.sql.SQLSession.acquireConnection(SQLSession.java:160)
              at org.nuxeo.ecm.directory.sql.SQLSession.<init>(SQLSession.java:135)
              at org.nuxeo.ecm.directory.sql.SQLDirectory.getSession(SQLDirectory.java:337)
              at org.nuxeo.ecm.directory.sql.SQLDirectoryProxy.getSession(SQLDirectoryProxy.java:88)
              at org.nuxeo.ecm.directory.DirectoryServiceImpl.open(DirectoryServiceImpl.java:272)
              at com.orange.wse.init.dao.InitFileDaoImpl.hasFile(InitFileDaoImpl.java:53)
              at com.orange.wse.init.WSEInitManagerImpl.isFileAlreadyUpdated(WSEInitManagerImpl.java:398)
              at com.orange.wse.init.WSEInitManagerImpl.onStartupComplete(WSEInitManagerImpl.java:132)
              at com.orange.wse.common.utils.Framework.serverStarted(Framework.java:239)
              at com.orange.wse.common.utils.Framework.frameworkEvent(Framework.java:258)
              at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:238)
              at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:232)
              at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:112)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.nuxeo.osgi.application.FrameworkBootstrap.start(FrameworkBootstrap.java:132)
              at org.nuxeo.runtime.tomcat.NuxeoLauncher.handleEvent(NuxeoLauncher.java:118)
              at org.nuxeo.runtime.tomcat.NuxeoLauncher.lifecycleEvent(NuxeoLauncher.java:89)
              at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
              at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
              at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
              at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5498)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
              at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
              at java.util.concurrent.FutureTask.run(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)
      Caused by: java.sql.SQLException: Auto-commit can not be set while enrolled in a transaction
              at org.apache.commons.dbcp.managed.ManagedConnection.setAutoCommit(ManagedConnection.java:206)
              at org.nuxeo.ecm.directory.sql.SQLSession.acquireConnection(SQLSession.java:157)
              ... 35 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: