Skip to main content
Can run on: Windows, Linux

Check Db Connections

Description

Check DB Connections is a process entry in the Conditions plugin for Process Studio processes. Use the entry to confirm that one or more databases are reachable before the rest of the process runs.

The entry opens each connection in the list, holds the connection open for the wait time you set, and then closes the connection. When a database is unavailable, the process stops early and names the reason in the log, instead of failing later, part way through the work.

When to use the entry:

  • At the start of a process that reads from or writes to several databases.
  • Before a long-running job, so a missing database shows up in seconds rather than hours later.
  • After database maintenance, to confirm that the server accepts connections again.

Prerequisites

  • At least one database connection is defined in the current process.
  • The account used by each connection can log in to the database.

Example

A nightly billing process writes to three databases: Orders, Invoices, and Reporting.

  • Place Check DB Connections as the first entry in the process.
  • Select Get connections to load all three connections into the grid.
  • For each row, set Wait to 2 and Units of Time to Seconds.

When any of the three databases is down, the process stops within a few seconds, and the log names the database at fault. When all three respond, the process continues to the billing entries.

How the entry behaves

  • The entry tests the connections one at a time, in the order shown in the grid.
  • When a connection opens, the entry counts a success, waits for the time you set, and then closes the connection.
  • When a connection does not open, the entry counts an error and writes the reason to the log.
  • The entry succeeds only when every connection opens successfully. A single error fails the entry.
  • When you stop the process, the entry finishes the connection currently under test and then stops. The entry does not test the connections that remain.
  • At the Detailed log level, the entry writes how many connections succeeded and how many returned an error.
  • When the grid is empty, the entry tests nothing and succeeds.

Configurations

Field NameDescription
ConnectionsThe grid listing the connections to test. The dialog has no tabs.
Process Entry nameSpecify a unique name for the entry on the workspace area. You can place the entry on the canvas more than once, but each copy needs a different name.
The field is mandatory.
ConnectionSelect the database connection to test. The drop-down list shows the connections defined in the current process. Add one row to the grid for every database you want to check.
WaitSpecify how long to hold the connection open after the connection opens successfully. Enter 0, or leave the field empty, to close the connection straight away.
Enter a whole number. When you select OK, the dialog turns the value into a number, so a variable such as ${DB_CHECK_WAIT} is saved as 0.
A short wait confirms that the database holds a connection open, and not only that the database answers the first request.
Units of timeSelect the unit that goes with the Wait number:
Milliseconds
Seconds
Minutes
Hours
Get connectionsSelect Get connections to fill the grid with every connection defined in the process. The button first clears the grid, and then adds one row per connection, with Wait set to 0 and Units of Time set to Milliseconds.
Use the button as the quick way to test all connections at once, and then change the wait times you need.
DeleteSelect a row in the grid, and then select Delete to remove the row. Removing a row stops the entry from testing the connection. The connection stays defined in the process.
You can select more than one row and remove them all at once.