YunaiV/ruoyi-vue-pro · critical · FlowableException
couldn't deduct database type from database product name '{}
Error message
couldn't deduct database type from database product name '{}' What it means
Flowable maps the JDBC DatabaseMetaData.getDatabaseProductName() string to an internal databaseType via databaseTypeMappings. If the product name is not a mapped key, databaseType is null and the engine cannot load the correct org/flowable/.../<type>.properties SQL dialect, throwing FlowableException.
Source
Thrown at sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java:522
// CRDB does not expose the version through the jdbc driver, so we need to fetch it through version().
if (PRODUCT_NAME_POSTGRES.equalsIgnoreCase(databaseProductName)) {
try (PreparedStatement preparedStatement = connection.prepareStatement("select version() as version;");
ResultSet resultSet = preparedStatement.executeQuery()) {
String version = null;
if (resultSet.next()) {
version = resultSet.getString("version");
}
if (StringUtils.isNotEmpty(version) && version.toLowerCase().startsWith(PRODUCT_NAME_CRDB.toLowerCase())) {
databaseProductName = PRODUCT_NAME_CRDB;
logger.info("CockroachDB version '{}' detected", version);
}
}
}
databaseType = databaseTypeMappings.getProperty(databaseProductName);
if (databaseType == null) {
throw new FlowableException("couldn't deduct database type from database product name '" + databaseProductName + "'");
}
logger.debug("using database type: {}", databaseType);
} catch (SQLException e) {
throw new RuntimeException("Exception while initializing Database connection", e);
} finally {
try {
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
logger.error("Exception while closing the Database connection", e);
}
}
// Special care for MSSQL, as it has a hard limit of 2000 params per statement (incl bulk statement).
// Especially with executions, with 100 as default, this limit is passed.
if (DATABASE_TYPE_MSSQL.equals(databaseType)) {View on GitHub (pinned to 0418084e22)
Solutions
- Set configuration.setDatabaseType(...) explicitly to the Flowable dialect key (e.g. 'dm', 'mysql', 'oracle') to bypass product-name detection.
- Register a mapping from the actual product name string to a Flowable databaseType via setDatabaseTypeMappings() before engine init.
- Log databaseProductName at startup to see the exact string that failed, then map it.
- Verify the JDBC driver is the correct one for your DB (a generic driver may report a generic product name).
Example fix
// before: relies on product-name auto-detection (fails for DM)
// after: set the type explicitly
cfg.setDatabaseType("dm");
// or extend the mapping:
Map<String,String> m = new HashMap<>(cfg.getDatabaseTypeMappings());
m.put("DM DBMS", "dm");
cfg.setDatabaseTypeMappings(m); Defensive patterns
Strategy: validation
Validate before calling
try (Connection c = dataSource.getConnection()) {
String name = c.getMetaData().getDatabaseProductName();
if (!knownFlowableTypes.contains(cfg.getDatabaseTypeMappings().get(name))) {
cfg.setDatabaseType("dm"); // explicit override
}
} Type guard
null
Try / catch
try { engine = cfg.buildProcessEngine(); }
catch (FlowableException e) {
if (e.getMessage().contains("couldn't deduct database type")) cfg.setDatabaseType("dm");
throw e;
} Prevention
- Set setDatabaseType() explicitly for non-standard DBs
- Register a custom product-name -> databaseType mapping before engine init
- Log the product name string from getMetaData() during onboarding a new DB
When it happens
Trigger: Connecting to a DB whose product name is unmapped (e.g. Dameng returns 'DM DBMS', a new Oracle build returns a slightly different string, or a proxy/wrapper driver alters the name); using a DB Flowable does not support out of the box.
Common situations: Adding Dameng/kingbase/opengauss support; JDBC driver upgrade changes the reported product name string; using a connection-pool/sharding middleware that rewrites metadata.
Related errors
- couldn't lookup datasource from {}: {}
- DataSource or JDBC properties have to be specified in a proc
- invalid command interceptor chain configuration: {}
- Error while building ibatis SqlSessionFactory: {}
- Exception while initializing Database connection
AI-assisted analysis of YunaiV/ruoyi-vue-pro@0418084e22 (2026-08-14).
Data as JSON: /api/errors/99450897d7f4da13.
Report an issue: GitHub.