{"record":{"id":"18c9a8f80e390105","repo":"flowable/flowable-engine","slug":"could-not-retrieve-database-metadata-e-getmes","errorCode":null,"errorMessage":"Could not retrieve database metadata: \" + e.getMessage()","messagePattern":"Could not retrieve database metadata: \" \\+ e\\.getMessage\\(\\)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java","lineNumber":199,"sourceCode":"                        String columnName = resultSet.getMetaData().getColumnName(i + 1);\n                        if (\"TABLE_SCHEM\".equalsIgnoreCase(columnName) || \"TABLE_SCHEMA\".equalsIgnoreCase(columnName)) {\n                            if (!schema.equalsIgnoreCase(resultSet.getString(resultSet.getMetaData().getColumnName(i + 1)))) {\n                                wrongSchema = true;\n                            }\n                            break;\n                        }\n                    }\n                }\n\n                if (!wrongSchema) {\n                    String name = resultSet.getString(\"COLUMN_NAME\").toUpperCase(Locale.ROOT);\n                    String type = resultSet.getString(\"TYPE_NAME\").toUpperCase(Locale.ROOT);\n                    result.addColumnMetaData(name, type);\n                }\n            }\n\n        } catch (SQLException e) {\n            throw new FlowableException(\"Could not retrieve database metadata: \" + e.getMessage());\n        }\n\n        if (result.getColumnNames().isEmpty()) {\n            // According to API, when a table doesn't exist, null should be returned\n            result = null;\n        }\n        return result;\n    }\n    \n    protected DbSqlSession getDbSqlSession() {\n        return Context.getCommandContext().getSession(DbSqlSession.class);\n    }\n\n}\n","sourceCodeStart":181,"sourceCodeEnd":214,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java#L181-L214","documentation":"Wrapper thrown by TableDataManagerImpl.getTableMetaData: reading DatabaseMetaData while enumerating tables (catalog/schema listing) failed with a SQLException; database connectivity or metadata permissions are broken.","triggerScenarios":"Querying a table's metadata via TableDataManager (e.g. from schema checks or table info queries) when getColumns() fails, or when the queried table name is invalid for the driver.","commonSituations":"Driver rejects case-sensitive or schema-qualified table names; metadata access denied; transient connection failure; table name uses reserved characters not escaped by the filter.","solutions":["Verify database connectivity and metadata privileges of the datasource user","Check the cause SQLException for the driver-level failure reason"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    TableMetaData meta = tableDataManager.getTableMetaData(tableName);\n} catch (FlowableException e) {\n    LOGGER.error(\"Column metadata failed for {}: {}\", tableName, e.getMessage(), e);\n}","preventionTips":["Match table name casing to the database convention","Keep the JDBC driver up to date","Verify metadata read permissions for the DB user"],"tags":["database","jdbc-metadata","sql"],"backgroundTag":"database-query-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}