{"record":{"id":"ad0728b6b189ea94","repo":"quarkusio/quarkus","slug":"this-isn-t-used-for-schema-generation-see-sessio","errorCode":null,"errorMessage":"This isn't used for schema generation - see SessionFactoryObserverForSchemaExport instead","messagePattern":"This isn't used for schema generation - see SessionFactoryObserverForSchemaExport instead","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootEntityManagerFactoryBuilder.java","lineNumber":108,"sourceCode":"            populate(puDescriptor.getName(), optionsBuilder, standardServiceRegistry);\n            return new SessionFactoryImpl(metadata, optionsBuilder.buildOptions(),\n                    metadata.getTypeConfiguration().getMetadataBuildingContext().getBootstrapContext());\n        } catch (Exception e) {\n            throw persistenceException(\"Unable to build Hibernate SessionFactory\", e);\n        } finally {\n            closeImportScripts();\n        }\n    }\n\n    @Override\n    public void cancel() {\n        // nothing?\n    }\n\n    @Override\n    public void generateSchema() {\n        try {\n            throw new UnsupportedOperationException(\n                    \"This isn't used for schema generation - see SessionFactoryObserverForSchemaExport instead\");\n        } finally {\n            closeImportScripts();\n        }\n    }\n\n    protected final void closeImportScripts() {\n        importScripts.close();\n    }\n\n    protected PersistenceException persistenceException(String message, Exception cause) {\n        // Provide a comprehensible message if there is an issue with SSL support\n        Throwable t = cause;\n        while (t != null) {\n            if (t instanceof NoSuchAlgorithmException) {\n                message += \"Unable to enable SSL support. You might be in the case where you used the `quarkus.ssl.native=false` configuration\"\n                        + \" and SSL was not disabled automatically for your driver.\";\n                break;","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootEntityManagerFactoryBuilder.java#L90-L126","documentation":"FastBootEntityManagerFactoryBuilder replaces Hibernate's normal EMF bootstrap in Quarkus; schema generation is not driven through the standard EntityManagerFactoryBuilder.generateSchema path. Instead Quarkus performs schema export via SessionFactoryObserverForSchemaExport, so calling generateSchema directly is an explicit UnsupportedOperationException.","triggerScenarios":"Calling EMFBuilder.generateSchema() (or Persistence.generateSchema / javax.persistence.schema-generation via the raw EMF) on Quarkus's fast-boot EMF — e.g. custom tooling invoking JPA schema generation APIs at runtime.","commonSituations":"Porting standard Hibernate/JPA code that calls generateSchema into a Quarkus app; running a schema tool harness expecting the JPA bootstrap contract.","solutions":["Let Quarkus handle schema generation via configuration: quarkus.hibernate-orm.database.generation=(create|drop-and-create|update).","Use Hibernate SchemaExport/SchemaUpdate tooling explicitly if you need manual control.","Register schema work through a SessionFactoryObserverForSchemaExport-compatible mechanism instead of the JPA bootstrap API."],"exampleFix":"// before\nemfBuilder.generateSchema();\n// after\n// application.properties\nquarkus.hibernate-orm.database.generation=drop-and-create","handlingStrategy":"try-catch","validationCode":"// Guard custom tooling before invoking generateSchema\nif (emfBuilder instanceof FastBootEntityManagerFactoryBuilder) {\n    throw new IllegalStateException(\"Use quarkus.hibernate-orm.database.generation instead\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    builder.generateSchema();\n} catch (UnsupportedOperationException e) {\n    log.warn(\"Schema generation handled by Quarkus config; set \"\n        + \"quarkus.hibernate-orm.database.generation instead\");\n}","preventionTips":["Configure schema via quarkus.hibernate-orm.database.generation, not JPA APIs","Use Hibernate SchemaExport tool for manual schema needs"],"tags":["schema-generation","unsupported-operation","hibernate-orm","quarkus"],"backgroundTag":"unsupported-operation","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}