YunaiV/yudao-cloud · 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 reads DatabaseMetaData.getDatabaseProductName() and maps it to an internal databaseType via the databaseTypeMappings Properties table. If the product name (after CockroachDB special-casing) has no entry, it throws this FlowableException showing the unrecognized name.
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 477be9dd49)
Solutions
- Set the database type explicitly so the mapping lookup is skipped: cfg.setDatabaseType("oracle") (or the closest compatible type).
- Add a mapping before engine build: cfg.setDatabaseTypeMappings(custom) or databaseTypeMappings.put('<product name>', 'oracle') on the configuration.
- Patch the driver/URL so the product name matches an expected key (some DM drivers accept a compatibility flag that reports 'Oracle').
- Verify the actual name via a quick JDBC snippet printing metaData.getDatabaseProductName().
Example fix
// before
ProcessEngineConfiguration cfg = ...; // auto-detect fails on DM DBMS
// after
ProcessEngineConfiguration cfg = ...;
cfg.setDatabaseType("oracle"); // DM is Oracle-compatible Defensive patterns
Strategy: validation
Validate before calling
try (Connection c = ds.getConnection()) {
String product = c.getMetaData().getDatabaseProductName();
String type = databaseTypeMappings.getProperty(product);
if (type == null) type = "oracle"; // DM fallback
cfg.setDatabaseType(type); // bypass auto-detection
} Try / catch
try { engine = cfg.buildProcessEngine(); }
catch (FlowableException e) {
if (e.getMessage().contains("couldn't deduct database type")) {
cfg.setDatabaseType("oracle"); // retry once with explicit type
engine = cfg.buildProcessEngine();
} else throw e;
} Prevention
- Always set databaseType explicitly on non-mainstream databases (DM, Oscar, Kingbase)
- Print getDatabaseProductName() once during environment bring-up and record it in runbooks
When it happens
Trigger: Connecting to a database whose product name is not a key in the built-in mappings — e.g. 'DM DBMS' from Dameng, 'OSCAR', a new Derby/H2 version string, or a proxy/wrapper driver that reports its own name. Only names like Oracle, MySQL, PostgreSQL, H2, SQL Server, DB2, etc. are mapped by default.
Common situations: Using DM (Dameng) or another national database with unpatched Flowable; a vendor-patched driver that changes DatabaseMetaData.getDatabaseProductName(); running against a database fork whose name string drifted (e.g. 'PostgreSQL-XL').
Related errors
- Error while building ibatis SqlSessionFactory: {}
- Cannot determine the Oracle database version number
- couldn't lookup datasource from {}: {}
- DataSource or JDBC properties have to be specified in a proc
- Exception while initializing Database connection
AI-assisted analysis of YunaiV/yudao-cloud@477be9dd49 (2026-08-14).
Data as JSON: /api/errors/26a7b816bb4b1582.
Report an issue: GitHub.