MuleSoft · Database Connector
DB:QUERY_EXECUTION
DB:QUERY_EXECUTION means the database accepted the connection but the execution of the query failed. Turn on verbose logging for Database Connector to see the database's own message, then fix the query, its parameters or its timeout.
VerifiedLast verified
01Error text
Error type: DB:QUERY_EXECUTION02Likely causes
- The query execution failed. The database's own error message says why.
- On Oracle, a query or stored procedure that runs for 15 to 30 minutes can have its connection closed by a firewall or network device.
- Columns in the result share a name, which causes a duplicate key error in the query metadata.
03How to fix it
- Turn on verbose logging: add
AsyncLoggerentries atDEBUGfororg.mule.extension.dbandorg.mule.db.commonsinlog4j2.xml, then read the database's message. Turn it off afterward. - Correct the SQL or the input parameters that the database rejected.
- For long-running Oracle statements, set the JVM parameter
-Doracle.net.keepAlive=true. - For duplicate column names, set Use Column Numbers to
true(useColumnNumbers="true") on the Select, Query Single or Stored Procedure operation. - Review Query Timeout on the operation. No timeout is used by default.
iNotes
Some problems are logged as a WARN and do not raise this error, for example a Select whose subquery returns more than one value, or a stored procedure in which one or more statements fail.
04Official documentation
→Related errors
- DB:BAD_SQL_SYNTAXDB:BAD_SQL_SYNTAX means the SQL query you gave Database Connector contains invalid syntax. Correct the statement for your database, and check any part of it that is built dynamically.
- DB:CONNECTIVITYDB:CONNECTIVITY covers several possible connection problems in Database Connector, including a poorly configured connection, no response from the database and a lost connection. Check the connection configuration first, then add a reconnection strategy.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer