{"record":{"id":"de4d5226294db42e","repo":"quarkusio/quarkus","slug":"while-using-transactional-we-need-a-databaseactio","errorCode":null,"errorMessage":"While using @Transactional we need a DatabaseActions Strategy. Something was wrong here","messagePattern":"While using @Transactional we need a DatabaseActions Strategy\\. Something was wrong here","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"critical","filePath":"extensions/reactive-transactions/runtime/src/main/java/io/quarkus/reactive/transaction/runtime/TransactionalInterceptorRequired.java","lineNumber":23,"sourceCode":"import jakarta.inject.Inject;\nimport jakarta.interceptor.AroundInvoke;\nimport jakarta.interceptor.Interceptor;\nimport jakarta.interceptor.InvocationContext;\nimport jakarta.transaction.Transactional;\n\n@Transactional(Transactional.TxType.REQUIRED)\n@Interceptor\n@Priority(Interceptor.Priority.PLATFORM_BEFORE + 300)\npublic class TransactionalInterceptorRequired extends TransactionalInterceptorBase {\n\n    @Inject\n    Instance<ReactiveResource> databaseActionsStrategy;\n\n    @AroundInvoke\n    public Object intercept(InvocationContext context) throws Exception {\n        ReactiveResource reactiveResource = this.databaseActionsStrategy.get();\n        if (reactiveResource == null) {\n            throw new UnsupportedOperationException(\n                    \"While using @Transactional we need a DatabaseActions Strategy. Something was wrong here\");\n        }\n        return doIntercept(context, reactiveResource);\n    }\n\n    @Override\n    protected void validateTransactionalType(InvocationContext context) {\n        // Required is supported\n    }\n}\n","sourceCodeStart":5,"sourceCodeEnd":34,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/reactive-transactions/runtime/src/main/java/io/quarkus/reactive/transaction/runtime/TransactionalInterceptorRequired.java#L5-L34","documentation":"Quarkus's @Transactional interceptor for reactive transactions resolves the ReactiveResource (DatabaseActions strategy) from CDI. The strategy bean is provided by an active reactive-datasource/transaction integration; if the Instance lookup returns null, the CDI container has no strategy bean and the interceptor refuses to proceed, since there is no way to execute transactional work.","triggerScenarios":"A method annotated with @Transactional is invoked while no reactive datasource (or other reactive transaction provider) dependency is on the classpath, or the strategy bean failed to be created at build/startup time.","commonSituations":"Adding quarkus-narayana-transactions or @Transactional without adding a datasource extension; using @Transactional in a module with only quarkus-hibernate-orm-panache removed; dependency exclusions that dropped the reactive datasource runtime; a broken build-time wiring after version upgrades.","solutions":["Add a reactive datasource extension dependency, e.g. io.quarkus:quarkus-reactive-datasource (or quarkus-hibernate-reactive-panache), so the ReactiveResource strategy bean exists","Configure the datasource (quarkus.datasource.db-kind=postgresql, credentials) so the reactive datasource starts and the strategy bean is produced","If you only need blocking JTA transactions, remove the reactive interceptor usage and ensure quarkus-narayana-transactions is present; check your dependencies for exclusions of quarkus-reactive-datasource runtime modules","Run mvn dependency:tree to confirm the reactive datasource/transaction runtime modules are actually resolved"],"exampleFix":"// before (pom.xml)\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-narayana-transactions</artifactId>\n</dependency>\n// after\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-reactive-datasource</artifactId>\n</dependency>","handlingStrategy":"validation","validationCode":"boolean ok = Class.forName(\"io.quarkus.reactive.datasource.runtime.ReactiveDatasourceStateConsumer\", false,\n    Thread.currentThread().getContextClassLoader()).getClass() != null; // build should include reactive datasource\n// simpler: assert a reactive db-kind is configured before startup\nif (!Arrays.asList(\"postgresql\",\"mariadb\",\"mysql\",\"mssql\",\"db2\",\"oracle\").contains(dbKind)) throw new IllegalStateException(\"reactive datasource missing\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair @Transactional usage with a datasource extension dependency","Smoke-test application startup in CI so missing beans fail at boot","Avoid mixing blocking-only transaction extensions with reactive endpoints without the reactive datasource"],"tags":["cdi","transactions","reactive","quarkus","missing-bean"],"backgroundTag":"missing-cdi-bean","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}