hibernate/hibernate-orm · error · UnsupportedOperationException

SingleStore does not support dropping creating/dropping sche

Error message

SingleStore does not support dropping creating/dropping schemas in the JDBC sense

What it means

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.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java:1008

	@Override
	public String[] getCreateCatalogCommand(String catalogName) {
		return new String[] {"create database " + catalogName};
	}

	@Override
	public String[] getDropCatalogCommand(String catalogName) {
		return new String[] {"drop database " + catalogName};
	}

	@Override
	public boolean canCreateSchema() {
		return false;
	}

	@Override
	public String[] getCreateSchemaCommand(String schemaName) {
		throw new UnsupportedOperationException(
				"SingleStore does not support dropping creating/dropping schemas in the JDBC sense" );
	}

	@Override
	public String[] getDropSchemaCommand(String schemaName) {
		throw new UnsupportedOperationException(
				"SingleStore does not support dropping creating/dropping schemas in the JDBC sense" );
	}

	@Override
	public boolean supportsIfExistsBeforeTableName() {
		return true;
	}

	@Override
	public String getSelectGUIDString() {
		return "select uuid()";
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Remove schema= from @Table/@SequenceGenerator and clear hibernate.default_schema; let the database in the JDBC URL be the namespace
  2. Provision databases out-of-band with CREATE DATABASE before the application or tests start
  3. If a namespace is required, treat it as the catalog (database), which the dialect supports via getCreateCatalogCommand
  4. Gate schema-provisioning code on dialect.canCreateSchema() instead of calling create-schema commands unconditionally

Example fix

// before - mapping names a schema Hibernate tries to create
@Table(name = 'orders', schema = 'sales')

// after - the database from the JDBC URL is the namespace
@Table(name = 'orders')
// jdbc:singlestore://host:3306/sales
Defensive patterns

Strategy: validation

Validate before calling

Dialect dialect = sessionFactory.getJdbcServices().getDialect();
if (!dialect.canCreateSchema()) {
    throw new IllegalStateException(
        'Target database cannot create schemas; provision the database out-of-band'
        + ' and remove schema= from mappings');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/49ad0ab4810731bc. Report an issue: GitHub.