{"record":{"id":"0386d65e196ea780","repo":"quarkusio/quarkus","slug":"attempting-to-boot-a-blocking-hibernate-orm-instan","errorCode":null,"errorMessage":"Attempting to boot a blocking Hibernate ORM instance on a reactive RecordedState","messagePattern":"Attempting to boot a blocking Hibernate ORM instance on a reactive RecordedState","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/FastBootHibernatePersistenceProvider.java","lineNumber":205,"sourceCode":"                    persistenceUnit.getName(), persistenceUnit.getProviderClassName(), persistenceUnitName);\n\n            final boolean matches = persistenceUnitName == null\n                    || persistenceUnit.getName().equals(persistenceUnitName);\n            if (!matches) {\n                log.debugf(\"Excluding from consideration '%s' due to name mismatch\", persistenceUnit.getName());\n                continue;\n            }\n\n            // See if we (Hibernate) are the persistence provider\n            if (!isProvider(persistenceUnit)) {\n                log.debug(\"Excluding from consideration due to provider mismatch\");\n                continue;\n            }\n\n            RecordedState recordedState = PersistenceUnitsHolder.popRecordedState(persistenceUnitName, false);\n\n            if (recordedState.isReactive()) {\n                throw new IllegalStateException(\n                        \"Attempting to boot a blocking Hibernate ORM instance on a reactive RecordedState\");\n            }\n            final PrevalidatedQuarkusMetadata metadata = recordedState.getMetadata();\n            var puConfig = hibernateOrmRuntimeConfig.persistenceUnits().get(persistenceUnit.getName());\n            if (puConfig.active().isPresent() && !puConfig.active().get()) {\n                throw new IllegalStateException(\n                        \"Attempting to boot a deactivated Hibernate ORM persistence unit\");\n            }\n            RuntimeSettingsResult runtimeSettingsResult = buildRuntimeSettings(persistenceUnitName, recordedState,\n                    puConfig);\n\n            StandardServiceRegistry standardServiceRegistry = rewireMetadataAndExtractServiceRegistry(persistenceUnitName,\n                    recordedState, puConfig, runtimeSettingsResult.settings());\n\n            final Object cdiBeanManager = Arc.container().beanManager();\n            final Object validatorFactory = Arc.container().instance(\"quarkus-hibernate-validator-factory\").get();\n\n            return new FastBootEntityManagerFactoryBuilder(","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/FastBootHibernatePersistenceProvider.java#L187-L223","documentation":"Blocking Hibernate ORM and Hibernate Reactive produce different build-time RecordedState objects. When a persistence unit was built as reactive but is booted through the blocking FastBootHibernatePersistenceProvider, getEntityManagerFactoryBuilderOrNull throws IllegalStateException because a reactive RecordedState cannot construct a blocking EntityManagerFactory.","triggerScenarios":"getEntityManagerFactoryBuilderOrNull pops the RecordedState via PersistenceUnitsHolder.popRecordedState and recordedState.isReactive() is true on the blocking provider path; reached via builder or getEntityManagerFactoryBuilder.","commonSituations":"hibernate-reactive configuration (quarkus.hibernate-reactive.*) on a PU then accessed with blocking bootstrap APIs; mixing blocking Panache with a reactive PU; copied blocking bootstrap code into a reactive project.","solutions":["Use Hibernate Reactive APIs (MutinySessionFactory) for reactive persistence units.","Remove quarkus.hibernate-reactive.* config if the PU should be blocking and configure via quarkus.hibernate-orm.*.","Split into separate PUs: reactive PUs for reactive code, blocking PUs for blocking code.","Match the Panache variant (hibernate-reactive-panache vs hibernate-orm-panache) to your access pattern."],"exampleFix":"// before (PU configured reactive, blocking bootstrap)\nEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"mypu\");\n// after\n@Inject\nMutinySessionFactory sessionFactory;","handlingStrategy":"validation","validationCode":"if (puUsesHibernateReactive(\"mypu\") && needsBlockingEntityManagerFactory) {\n    throw new IllegalStateException(\"mypu is reactive; use MutinySessionFactory instead\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Persistence.createEntityManagerFactory(\"mypu\");\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"reactive RecordedState\")) {\n        throw new IllegalStateException(\"Use Hibernate Reactive APIs for this PU\", e);\n    } else throw e;\n}","preventionTips":["Match blocking vs reactive APIs to the extension that configured the PU.","Avoid configuring the same PU with both quarkus.hibernate-orm.* and quarkus.hibernate-reactive.*.","Keep Panache variant aligned (orm-panache vs reactive-panache)."],"tags":["quarkus","hibernate-orm","hibernate-reactive","reactive","mismatch"],"backgroundTag":"reactive-blocking-mismatch","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"}