hibernate/hibernate-orm · error · UnsupportedOperationException
No drop schema syntax supported by " + getClass().getName()
Error message
No drop schema syntax supported by " + getClass().getName()
What it means
FirebirdDialect.getDropSchemaCommand throws UnsupportedOperationException (and canCreateSchema() returns false) because Firebird has no DROP SCHEMA statement - schemas map to database users and cannot be dropped as objects. The exception comes from Hibernate's schema dropper/migration tooling when it tries to dispose of a namespace.
Source
Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java:595
"POSITION", "SUM", "TRIM", "UPPER" );
}
return super.buildIdentifierHelper( builder, metadata );
}
@Override
public boolean canCreateSchema() {
return false;
}
@Override
public String[] getCreateSchemaCommand(String schemaName) {
throw new UnsupportedOperationException( "No create schema syntax supported by " + getClass().getName() );
}
@Override
public String[] getDropSchemaCommand(String schemaName) {
throw new UnsupportedOperationException( "No drop schema syntax supported by " + getClass().getName() );
}
@Override
public boolean qualifyIndexName() {
return false;
}
@Override
public boolean supportsCommentOn() {
return getVersion().isSameOrAfter( 2, 0 );
}
@Override
public boolean supportsLobValueChangePropagation() {
// May need changes in Jaybird for this to work
return false;
}View on GitHub (pinned to fad1729dce)
Solutions
- Set 'hibernate.hbm2ddl.create_namespaces' to false (or remove it) so the dropper never requests DROP SCHEMA
- Remove schema qualifiers (default_schema / @Table(schema=...)) from the Firebird mappings
- Do schema lifecycle manually in Firebird-aware scripts (drop/recreate the database file or objects), not through Hibernate tooling
- Prefer 'create' or validated schema modes for Firebird test databases instead of drop-and-create with namespaces
Example fix
// before (throws during drop phase on Firebird) Map<String, Object> props = new HashMap<>(); props.put(AvailableSettings.HBM2DDL_AUTO, "drop-and-create"); props.put(AvailableSettings.HBM2DDL_CREATE_NAMESPACES, true); // after (no namespace lifecycle through Hibernate) props.put(AvailableSettings.HBM2DDL_AUTO, "drop-and-create");
Defensive patterns
Strategy: validation
Validate before calling
Dialect d = sessionFactory.getJdbcServices().getDialect();
if (!d.canCreateSchema()) {
// configure dropper without namespace handling
props.remove(AvailableSettings.HBM2DDL_CREATE_NAMESPACES);
} Type guard
static boolean schemaDropSafe(Dialect d) {
return d.canCreateSchema(); // FirebirdDialect returns false and throws on drop
} Try / catch
try {
new SchemaExport().drop(TargetType.DATABASE, metadata);
} catch (UnsupportedOperationException e) {
if (e.getMessage().contains("drop schema")) {
// drop objects only (tables/sequences) and skip namespaces
} else throw e;
} Prevention
- Use 'create' or 'none' instead of drop-and-create for Firebird test databases
- Keep schema lifecycle out of Hibernate for Firebird; script it with the DB's own tools
- Assert canCreateSchema() in a configuration self-check when multiple persistence units share settings
When it happens
Trigger: Running hbm2ddl drop/drop-and-create with 'hibernate.hbm2ddl.create_namespaces=true', SchemaExport.drop(true, ...), or any tooling that asks the dialect for DROP SCHEMA on Firebird - typically because default-schema is set in mappings or the URL.
Common situations: drop-and-create test teardown copied from another database's configuration; Flyway/Liquibase-managed projects that additionally run Hibernate schema cleanup; multi-database products where the Firebird persistence unit inherited schema lifecycle settings.
Related errors
- No create schema syntax supported by " + getClass().getName(
- "No create schema syntax supported by " + getClass().getName
- "No drop schema syntax supported by " + getClass().getName()
- Error performing schema management [persistence unit: {}]
- Halting on error : %s
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/ef6a020367d37273.
Report an issue: GitHub.