MuleSoft · Database Connector

DB:QUERY_EXECUTION

Short answer

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

MuleSoft error
Error type: DB:QUERY_EXECUTION

02Likely 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

  1. Turn on verbose logging: add AsyncLogger entries at DEBUG for org.mule.extension.db and org.mule.db.commons in log4j2.xml, then read the database's message. Turn it off afterward.
  2. Correct the SQL or the input parameters that the database rejected.
  3. For long-running Oracle statements, set the JVM parameter -Doracle.net.keepAlive=true.
  4. For duplicate column names, set Use Column Numbers to true (useColumnNumbers="true") on the Select, Query Single or Stored Procedure operation.
  5. 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

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

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.