Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-2004

MSSQL 2016 wrong syntax 'AUTO_INCREMENT' when creating tables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • AMQ 7.2.3.GA
    • AMQ 7.2.1.GA
    • jdbc
    • None
    • AMQ Broker 1848

      There is a problem when using MSSQL 2016 right after start of broker, when broker connects to DB and auto-creates needed tables.

      2018-09-25 09:11:50,803 ERROR [org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver]
      SQL STATEMENTS:
      CREATE TABLE PG_TBL (ID BIGINT AUTO_INCREMENT, FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA BLOB, PRIMARY KEY(ID))
      SQL EXCEPTIONS:
      SQLState: S0001 ErrorCode: 102 Message: Incorrect syntax near 'AUTO_INCREMENT'.
      
      2018-09-25 09:11:46,650 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
      2018-09-25 09:11:46,791 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,jdbcDriverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver,jdbcConnectionUrl=jdbc:sqlserver://mssql-2016.rhev-ci-vms.eng.rdu2.redhat.com:1433;DatabaseName=dballo02;user=dballo02;password=dballo02,messageTableName=MESSAGE_TABLE,bindingsTableName=BINDINGS_TABLE,largeMessageTableName=LARGE_MESSAGES_TABLE,pageStoreTableName=PG_TBL,)
      2018-09-25 09:11:49,564 ERROR [org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver]
      SQL STATEMENTS:
      CREATE TABLE LARGE_MESSAGES_TABLE (ID BIGINT AUTO_INCREMENT, FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA BLOB, PRIMARY KEY(ID))
      SQL EXCEPTIONS:
      SQLState: S0001 ErrorCode: 102 Message: Incorrect syntax near 'AUTO_INCREMENT'.
      2018-09-25 09:11:49,689 WARN  [org.apache.activemq.artemis.core.server] AMQ222010: Critical IO Error, shutting down the server. file=NULL, message=Unable to start database driver: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'AUTO_INCREMENT'.
              at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1547) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:857) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:757) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7344) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2713) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:224) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:204) [mssql-jdbc-6.4.0.jre8.jar:]
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:685) [mssql-jdbc-6.4.0.jre8.jar:]
              at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.createTableIfNotExists(AbstractJDBCDriver.java:258) [artemis-jdbc-store-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.createTable(AbstractJDBCDriver.java:118) [artemis-jdbc-store-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactoryDriver.createSchema(JDBCSequentialFileFactoryDriver.java:69) [artemis-jdbc-store-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.start(AbstractJDBCDriver.java:83) [artemis-jdbc-store-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactory.start(JDBCSequentialFileFactory.java:131) [artemis-jdbc-store-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.persistence.impl.journal.JDBCJournalStorageManager.init(JDBCJournalStorageManager.java:92) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.<init>(AbstractJournalStorageManager.java:229) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.<init>(JournalStorageManager.java:106) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.persistence.impl.journal.JDBCJournalStorageManager.<init>(JDBCJournalStorageManager.java:55) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createStorageManager(ActiveMQServerImpl.java:2155) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:2296) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:64) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:535) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:474) [artemis-server-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:111) [artemis-cli-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:82) [artemis-cli-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:149) [artemis-cli-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:97) [artemis-cli-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:124) [artemis-cli-2.6.3.redhat-00004.jar:2.6.3.redhat-00004]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_161]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_161]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
              at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129) [artemis-boot.jar:2.6.3.redhat-00004]
              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49) [artemis-boot.jar:2.6.3.redhat-00004]
      

              fnigro Francesco Nigro
              mtoth@redhat.com Michal Toth
              Michal Toth Michal Toth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: