com.microsoft.sqlserver.jdbc.SQLServerException: The object 'dot_containers' does not exist or is invalid for this operation.

Google Groups | David Petersheim | 3 months ago
  1. 0

    Error during upgrade, dot_containers

    Google Groups | 3 months ago | David Petersheim
    com.microsoft.sqlserver.jdbc.SQLServerException: The object 'dot_containers' does not exist or is invalid for this operation.
  2. 0

    We use identity generation with GenerationTyp.AUTO to support different DBMS (mssql and postgre) with a sequence generator for each Entity: {code:java} @SequenceGenerator(name = "SEQ_MY_CLASS", sequenceName = "SEQ_MY_CLASS") public class MyClass { private Integer id; .... @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MY_CLASS") public Integer getId(){ ... } } {code} persistence.xml {code:xml} ... <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.default_schema" value="myschema" /> <property name="hibernate.default_catalog" value="mydatabase" /> <property name="hibernate.id.new_generator_mappings" value="true"/> ... {code} Hibernate generates the following SQL for creating the sequence, but MSSQL doesn't support providing catalog name on sequence creation. {code:sql} create sequence mycatalog.myschema.SEQ_MY_CLASS start with 1 increment by 50 {code} As result we receive the following Exception on wildfly startup: {code:java} 2016-06-09 13:13:30 INFO [ServerService Thread Pool -- 54] [] stdout: Hibernate: create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50 2016-06-09 13:13:30 WARN [ServerService Thread Pool -- 54] [] org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:567) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:551) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:289) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:137) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:110) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:176) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667) [wildfly-elytron-1.0.2.Final.jar:1.0.2.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45] at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'CREATE SEQUENCE' does not allow specifying the database name as a prefix to the object name. 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.jboss.jca.adapters.jdbc.WrappedStatement.execute(WrappedStatement.java:198) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:51) ... 19 more {code}

    Hibernate JIRA | 6 months ago | Johannes Zinn
    org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]
  3. 0

    We use identity generation with GenerationTyp.AUTO to support different DBMS (mssql and postgre) with a sequence generator for each Entity: {code:java} @SequenceGenerator(name = "SEQ_MY_CLASS", sequenceName = "SEQ_MY_CLASS") public class MyClass { private Integer id; .... @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MY_CLASS") public Integer getId(){ ... } } {code} persistence.xml {code:xml} ... <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.default_schema" value="myschema" /> <property name="hibernate.default_catalog" value="mydatabase" /> <property name="hibernate.id.new_generator_mappings" value="true"/> ... {code} Hibernate generates the following SQL for creating the sequence, but MSSQL doesn't support providing catalog name on sequence creation. {code:sql} create sequence mycatalog.myschema.SEQ_MY_CLASS start with 1 increment by 50 {code} As result we receive the following Exception on wildfly startup: {code:java} 2016-06-09 13:13:30 INFO [ServerService Thread Pool -- 54] [] stdout: Hibernate: create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50 2016-06-09 13:13:30 WARN [ServerService Thread Pool -- 54] [] org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:567) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:551) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:289) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:137) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:110) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:176) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667) [wildfly-elytron-1.0.2.Final.jar:1.0.2.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45] at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'CREATE SEQUENCE' does not allow specifying the database name as a prefix to the object name. 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.jboss.jca.adapters.jdbc.WrappedStatement.execute(WrappedStatement.java:198) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:51) ... 19 more {code}

    Hibernate JIRA | 6 months ago | Johannes Zinn
    org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Transaction Isolation Snapshot Exception on 2.1.1 upgrade

    GitHub | 4 years ago | NickPadilla
    com.microsoft.sqlserver.jdbc.SQLServerException: Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation.
  6. 0

    Email addresses are NULL in users.csv file

    GitHub | 2 years ago | Rosetjau
    com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'UQ__T_USER__AB6E6164C83765C0'. Cannot insert duplicate key in object 'dbo.T_USER'. The duplicate key value is (<NULL>).

    9 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.microsoft.sqlserver.jdbc.SQLServerException

      The object 'dot_containers' does not exist or is invalid for this operation.

      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError()
    2. com.microsoft.sqlserver
      SQLServerStatement.execute
      1. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)[sqljdbc42.jar:?]
      2. com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)[sqljdbc42.jar:?]
      3. com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)[sqljdbc42.jar:?]
      4. com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)[sqljdbc42.jar:?]
      5. com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)[sqljdbc42.jar:?]
      6. com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)[sqljdbc42.jar:?]
      7. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)[sqljdbc42.jar:?]
      8. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)[sqljdbc42.jar:?]
      9. com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)[sqljdbc42.jar:?]
      9 frames
    3. org.apache.tomcat
      DelegatingStatement.execute
      1. org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:290)[tomcat-dbcp.jar:8.0.18]
      2. org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:290)[tomcat-dbcp.jar:8.0.18]
      2 frames
    4. com.dotmarketing.common
      DotConnect.executeStatement
      1. com.dotmarketing.common.db.DotConnect.executeStatement(DotConnect.java:222)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
      1 frame
    5. com.dotmarketing.startup
      StartupTasksExecutor.executeUpgrades
      1. com.dotmarketing.startup.AbstractJDBCStartupTask.executeUpgrade(AbstractJDBCStartupTask.java:192)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
      2. com.dotmarketing.startup.StartupTasksExecutor.executeUpgrades(StartupTasksExecutor.java:268)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
      2 frames
    6. Liferay Portal Impl
      MainServlet.init
      1. com.liferay.portal.servlet.MainServlet.init(MainServlet.java:116)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
      1 frame
    7. Glassfish Core
      StandardWrapper.initServlet
      1. org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)[catalina.jar:8.0.18]
      1 frame