{"record":{"id":"49ad0ab4810731bc","repo":"hibernate/hibernate-orm","slug":"singlestore-does-not-support-dropping-creating-dro","errorCode":null,"errorMessage":"SingleStore does not support dropping creating/dropping schemas in the JDBC sense","messagePattern":"SingleStore does not support dropping creating/dropping schemas in the JDBC sense","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java","lineNumber":1008,"sourceCode":"\n\t@Override\n\tpublic String[] getCreateCatalogCommand(String catalogName) {\n\t\treturn new String[] {\"create database \" + catalogName};\n\t}\n\n\t@Override\n\tpublic String[] getDropCatalogCommand(String catalogName) {\n\t\treturn new String[] {\"drop database \" + catalogName};\n\t}\n\n\t@Override\n\tpublic boolean canCreateSchema() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic String[] getCreateSchemaCommand(String schemaName) {\n\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\"SingleStore does not support dropping creating/dropping schemas in the JDBC sense\" );\n\t}\n\n\t@Override\n\tpublic String[] getDropSchemaCommand(String schemaName) {\n\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\"SingleStore does not support dropping creating/dropping schemas in the JDBC sense\" );\n\t}\n\n\t@Override\n\tpublic boolean supportsIfExistsBeforeTableName() {\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic String getSelectGUIDString() {\n\t\treturn \"select uuid()\";\n\t}","sourceCodeStart":990,"sourceCodeEnd":1026,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java#L990-L1026","documentation":"SingleStoreDialect.getCreateSchemaCommand() always throws: SingleStore has no JDBC-style schemas - a schema is a database, created with CREATE DATABASE (the dialect maps catalog commands to create/drop database and reports canCreateSchema() == false). Hibernate's schema tooling reaches this method when entity mappings or settings reference a schema that Hibernate is asked to create, for example during SchemaExport.create or multi-tenant schema provisioning.","triggerScenarios":"Running SchemaExport.create/drop or hbm2ddl auto modes while entities declare @Table(schema=...) or hibernate.default_schema is set; multi-tenant bootstrap code that calls new SchemaExport().create for a per-tenant schema name.","commonSituations":"Reusing multi-tenant configuration from PostgreSQL where schema-per-tenant is standard; importing an entity model with a hardcoded schema attribute into a SingleStore project; CI pipelines that drop-and-create the schema before tests.","solutions":["Remove schema= from @Table/@SequenceGenerator and clear hibernate.default_schema; let the database in the JDBC URL be the namespace","Provision databases out-of-band with CREATE DATABASE before the application or tests start","If a namespace is required, treat it as the catalog (database), which the dialect supports via getCreateCatalogCommand","Gate schema-provisioning code on dialect.canCreateSchema() instead of calling create-schema commands unconditionally"],"exampleFix":"// before - mapping names a schema Hibernate tries to create\n@Table(name = 'orders', schema = 'sales')\n\n// after - the database from the JDBC URL is the namespace\n@Table(name = 'orders')\n// jdbc:singlestore://host:3306/sales","handlingStrategy":"validation","validationCode":"Dialect dialect = sessionFactory.getJdbcServices().getDialect();\nif (!dialect.canCreateSchema()) {\n    throw new IllegalStateException(\n        'Target database cannot create schemas; provision the database out-of-band'\n        + ' and remove schema= from mappings');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not put schema= in @Table for SingleStore; the JDBC URL database is the namespace","Provision databases with CREATE DATABASE scripts before app start","Gate every schema-provisioning code path on canCreateSchema()"],"tags":["hibernate","singlestore","dialect","schema","multi-tenant","ddl"],"backgroundTag":"unsupported-schema-management","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}