[jOOQ/jOOQ#15509] Add a log message whenever an exception occurs with
the SQLDialect.DEFAULT
This commit is contained in:
parent
e5c7e81553
commit
273af6ffa9
@ -102,6 +102,7 @@ class DefaultExecuteContext implements ExecuteContext {
|
||||
|
||||
private static final JooqLogger log = JooqLogger.getLogger(DefaultExecuteContext.class);
|
||||
private static final JooqLogger logVersionSupport = JooqLogger.getLogger(DefaultExecuteContext.class, "logVersionSupport", 1);
|
||||
private static final JooqLogger logDefaultDialect = JooqLogger.getLogger(DefaultExecuteContext.class, "logDefaultDialect", 3);
|
||||
|
||||
// Persistent attributes (repeatable)
|
||||
private final ConverterContext converterContext;
|
||||
@ -809,6 +810,23 @@ class DefaultExecuteContext implements ExecuteContext {
|
||||
public final void sqlException(SQLException e) {
|
||||
this.sqlException = e;
|
||||
exception(Tools.translate(sql(), e));
|
||||
|
||||
if (family() == SQLDialect.DEFAULT && logDefaultDialect.isWarnEnabled())
|
||||
logDefaultDialect.warn("Unsupported dialect",
|
||||
"""
|
||||
An exception was thrown when executing a query with unsupported dialect: SQLDialect.DEFAULT.
|
||||
|
||||
This is usually due to one of 2 reasons:
|
||||
- The dialect was configured by accident (e.g. through a wrong Spring Boot configuration).
|
||||
In this case, the solution is to configure the correct dialect, e.g. SQLDialect.POSTGRES
|
||||
- SQLDialect.DEFAULT is used as a "close enough" approximation of an unsupported dialect.
|
||||
Please beware that SQLDialect.DEFAULT is used mainly for DEBUG logging SQL strings, e.g.
|
||||
when calling Query.toString(). It does not guarantee stability of generated SQL, i.e.
|
||||
future versions of jOOQ may produce different SQL strings, which may break assumptions
|
||||
about your unsupported dialect.
|
||||
Please visit https://github.com/jOOQ/jOOQ/discussions/14059 for new dialect support.
|
||||
"""
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user