MuleSoft · Database Connector

DB:CONNECTIVITY

Short answer

DB: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.

VerifiedLast verified

01Error text

MuleSoft error
Error type: DB:CONNECTIVITY

02Likely causes

  • Any of several connectivity issues, including poorly configured connections, lack of a database response and loss of connection.
  • Without a reconnection strategy, the default behavior is for the operation to fail immediately and return a connectivity error.
  • On CloudHub with a static IP, the connectivity test at deployment can run before the static IP is assigned. The docs list the message Could not obtain connection from data source for this case.

03How to fix it

  1. Check the Database configuration: host, port, database name, user and password for the environment the app runs in.
  2. Add a reconnection strategy to the connection, for example <reconnection><reconnect frequency="4000" count="5"/></reconnection>. frequency is in milliseconds and defaults to 2000, and count defaults to 2.
  3. If the flow hangs or fails under load, check the pooling profile. A pool with fewer connections than the flow needs is a documented cause, and raising maxPoolSize is the fix.
  4. For the CloudHub static IP case, set the system property -DdoTestConnectivity=false.
  5. Turn on verbose logging: add AsyncLogger entries at DEBUG for org.mule.extension.db and org.mule.db.commons in log4j2.xml. Turn it off afterward.

iNotes

Database Connector also has more specific types: DB:CANNOT_REACH (cannot establish a connection with the RDBMS), DB:INVALID_CREDENTIALS (the database rejects the credentials), DB:INVALID_DATABASE (the database does not exist) and DB:CANNOT_LOAD_DRIVER (the JDBC driver cannot be loaded).

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.