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

Fix database init when nuxeo running against SQL Server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.10
    • Component/s: Core

      Description

      It seems that since we run session inside a transaction, the database creation on SQL Server didn't run anymore.

      Issue seen https://qa.nuxeo.org/jenkins/view/All/job/master/job/nuxeo-master-fullbuild-part1-multidb-linux/Slave=MULTIDB_LINUX,dbprofile=mssql,jdk=java-8-oracle/66/

      StackTrace :

      05:16:30,217 main ERROR [RegistrationInfoImpl] Component service:org.nuxeo.ecm.core.repository.RepositoryServiceComponent notification of application started failed: java.sql.SQLException: Error executing: CREATE FULLTEXT INDEX ON [fulltext] ([simpletext] LANGUAGE 'French', [binarytext] LANGUAGE 'French') KEY INDEX [fulltext_pk] ON [nuxeo] : CREATE FULLTEXT INDEX statement cannot be used inside a user transaction.
      org.nuxeo.ecm.core.api.NuxeoException: java.sql.SQLException: Error executing: CREATE FULLTEXT INDEX ON [fulltext] ([simpletext] LANGUAGE 'French', [binarytext] LANGUAGE 'French') KEY INDEX [fulltext_pk] ON [nuxeo] : CREATE FULLTEXT INDEX statement cannot be used inside a user transaction.
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.createDatabase(JDBCMapper.java:166)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doInvoke(JDBCMapperConnector.java:42)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:85)
      	at com.sun.proxy.$Proxy35.createDatabase(Unknown Source)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCBackend.newMapper(JDBCBackend.java:234)
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.newMapper(RepositoryImpl.java:269)
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.getConnection(RepositoryImpl.java:251)
      	at org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl.initialize(ManagedConnectionFactoryImpl.java:277)
      	at org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:184)
      	at org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:49)
      	at org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor.getConnection(XAResourceInsertionInterceptor.java:41)
      	at org.apache.geronimo.connector.outbound.SinglePoolMatchAllConnectionInterceptor.internalGetConnection(SinglePoolMatchAllConnectionInterceptor.java:88)
      	at org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:80)
      	at org.apache.geronimo.connector.outbound.ThreadLocalCachingConnectionInterceptor.getConnection(ThreadLocalCachingConnectionInterceptor.java:70)
      	at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:49)
      	at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:101)
      	at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
      	at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
      	at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
      	at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:77)
      	at org.nuxeo.runtime.jtajca.NuxeoContainer$ConnectionManagerWrapper.allocateConnection(NuxeoContainer.java:857)
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:103)
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getSession(ConnectionFactoryImpl.java:166)
      	at org.nuxeo.ecm.core.repository.RepositoryService.getSession(RepositoryService.java:212)
      	at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:125)
      	at org.nuxeo.ecm.core.api.local.LocalSession.<init>(LocalSession.java:83)
      	at org.nuxeo.ecm.core.api.CoreSessionServiceImpl.createCoreSession(CoreSessionServiceImpl.java:43)
      	at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:168)
      	at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:68)
      	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:129)
      	at org.nuxeo.ecm.core.repository.RepositoryService.openRepository(RepositoryService.java:127)
      	at org.nuxeo.ecm.core.repository.RepositoryService.initRepositories(RepositoryService.java:98)
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:459)
      	at org.nuxeo.ecm.core.repository.RepositoryService.applicationStarted(RepositoryService.java:87)
      	at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.notifyApplicationStarted(RegistrationInfoImpl.java:332)
      	at org.nuxeo.runtime.osgi.OSGiRuntimeService.notifyComponentsOnStarted(OSGiRuntimeService.java:487)
      	at org.nuxeo.runtime.osgi.OSGiRuntimeService.fireApplicationStarted(OSGiRuntimeService.java:523)
      	at org.nuxeo.runtime.api.ServicePassivator$Waiter.proceed(ServicePassivator.java:415)
      	at org.nuxeo.runtime.api.ServicePassivator.proceed(ServicePassivator.java:83)
      	at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:535)
      	at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:232)
      	at org.nuxeo.runtime.test.NXRuntimeTestCase.fireFrameworkStarted(NXRuntimeTestCase.java:193)
      	at org.nuxeo.runtime.test.runner.RuntimeFeature.beforeRun(RuntimeFeature.java:153)
      	at org.nuxeo.runtime.test.runner.FeaturesRunner$2.call(FeaturesRunner.java:157)
      	at org.nuxeo.runtime.test.runner.FeaturesLoader.apply(FeaturesLoader.java:127)
      	at org.nuxeo.runtime.test.runner.FeaturesLoader.apply(FeaturesLoader.java:114)
      	at org.nuxeo.runtime.test.runner.FeaturesRunner.beforeRun(FeaturesRunner.java:153)
      	at org.nuxeo.runtime.test.runner.FeaturesRunner$BeforeClassStatement.evaluate(FeaturesRunner.java:265)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.junit.runners.Suite.runChild(Suite.java:127)
      	at org.junit.runners.Suite.runChild(Suite.java:26)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:113)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:85)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:54)
      	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:134)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Caused by: java.sql.SQLException: Error executing: CREATE FULLTEXT INDEX ON [fulltext] ([simpletext] LANGUAGE 'French', [binarytext] LANGUAGE 'French') KEY INDEX [fulltext_pk] ON [nuxeo] : CREATE FULLTEXT INDEX statement cannot be used inside a user transaction.
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.createTables(JDBCMapper.java:382)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.createDatabase(JDBCMapper.java:164)
      	... 70 more
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: CREATE FULLTEXT INDEX statement cannot be used inside a user transaction.
      	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
      	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
      	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)
      	at org.tranql.connector.jdbc.StatementHandle.execute(StatementHandle.java:119)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.createTables(JDBCMapper.java:380)
      	... 71 more
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: