{"record":{"id":"31874171fe269ed9","repo":"quarkusio/quarkus","slug":"driver-drivername-is-an-xa-datasource-but-xa-tr-318741","errorCode":null,"errorMessage":"Driver <driverName> is an XA datasource, but XA transactions have not been enabled on the datasource named '<fullDataSourceName>'; please either set 'quarkus.datasource.<fullDataSourceName>.jdbc.transactions=xa' or switch to a standard non-XA JDBC driver implementation","messagePattern":"Driver <driverName> is an XA datasource, but XA transactions have not been enabled on the datasource named '<fullDataSourceName>'; please either set 'quarkus\\.datasource\\.<fullDataSourceName>\\.jdbc\\.transactions=xa' or switch to a standard non-XA JDBC driver implementation","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/component/DataSourceDefinitionBlockingProcessor.java","lineNumber":230,"sourceCode":"        } catch (ClassNotFoundException e) {\n            throw new ConfigurationException(\n                    \"Unable to load the datasource driver \" + driverName + \" for the \" + fullDataSourceName, e);\n        }\n        if (jdbcBuildTimeConfig.transactions() == TransactionIntegration.XA) {\n            if (!XADataSource.class.isAssignableFrom(driver)) {\n                throw new ConfigurationException(\n                        \"Driver is not an XA dataSource, while XA has been enabled in the configuration of the \"\n                                + fullDataSourceName + \": either disable XA or switch the driver to an XADataSource\");\n            }\n        } else {\n            if (driver != null && !javax.sql.DataSource.class.isAssignableFrom(driver)\n                    && !Driver.class.isAssignableFrom(driver)) {\n                if (aggregatedConfig.isDefault()) {\n                    throw new ConfigurationException(\n                            \"Driver \" + driverName\n                                    + \" is an XA datasource, but XA transactions have not been enabled on the default datasource; please either set 'quarkus.datasource.jdbc.transactions=xa' or switch to a standard non-XA JDBC driver implementation\");\n                } else {\n                    throw new ConfigurationException(\n                            \"Driver \" + driverName\n                                    + \" is an XA datasource, but XA transactions have not been enabled on the datasource named '\"\n                                    + fullDataSourceName + \"'; please either set 'quarkus.datasource.\" + fullDataSourceName\n                                    + \".jdbc.transactions=xa' or switch to a standard non-XA JDBC driver implementation\");\n                }\n            }\n        }\n    }\n\n    private String resolveDriver(String dataSourceName, String dbKind,\n            DataSourceJdbcBuildTimeConfig dataSourceJdbcBuildTimeConfig, List<JdbcDriverBuildItem> jdbcDriverBuildItems) {\n        if (dataSourceJdbcBuildTimeConfig.driver().isPresent()) {\n            return dataSourceJdbcBuildTimeConfig.driver().get();\n        }\n\n        Optional<JdbcDriverBuildItem> matchingJdbcDriver = jdbcDriverBuildItems.stream()\n                .filter(i -> dbKind.equals(i.getDbKind()))\n                .findFirst();","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/component/DataSourceDefinitionBlockingProcessor.java#L212-L248","documentation":"Same condition as error 526 (an XADataSource driver configured without transactions=xa) but for a named (non-default) datasource, so the message names the datasource and its property key quarkus.datasource.<name>.jdbc.transactions=xa.","triggerScenarios":"jdbcBuildTimeConfig.transactions() != XA, the driver fails both DataSource and Driver assignability checks (it is an XADataSource), and aggregatedConfig.isDefault() is false; the message embeds fullDataSourceName.","commonSituations":"Named datasources (quarkus.datasource.orders.*) configured with an XA driver class but no transactions=xa for that named datasource.","solutions":["Set quarkus.datasource.<name>.jdbc.transactions=xa for the named datasource.","Or switch that datasource's driver to a non-XA implementation (DataSource or Driver)."],"exampleFix":"// before\nquarkus.datasource.orders.jdbc.driver=org.postgresql.xa.PGXADataSource\n// after\nquarkus.datasource.orders.jdbc.driver=org.postgresql.xa.PGXADataSource\nquarkus.datasource.orders.jdbc.transactions=xa","handlingStrategy":"validation","validationCode":"String ds = \"orders\";\nboolean xa = \"xa\".equals(ConfigProvider.getConfig().getValue(\"quarkus.datasource.\" + ds + \".jdbc.transactions\", String.class));\nClass<?> d = Class.forName(ConfigProvider.getConfig().getValue(\"quarkus.datasource.\" + ds + \".jdbc.driver\", String.class));\nif (!xa && javax.sql.XADataSource.class.isAssignableFrom(d)) throw new IllegalStateException(\"Datasource \" + ds + \" uses XA driver without transactions=xa\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For each named datasource, verify driver class and transactions setting are consistent.","Do not copy default-datasource XA assumptions onto named datasources without setting their own transactions property."],"tags":["quarkus","agroal","jdbc","xa","transactions","named-datasource"],"backgroundTag":"xa-driver-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"}