User database connections

This topic describes how to determine the number of database connections a broker requires for capacity and resource planning. The broker makes a database connection to the ODBC data source name (DSN) for each DSN even if different DSNs resolve to the same physical database.

The number of connections to a user database that a broker requires depends on the actions of the message flows that access the database. For each broker that accesses a database, one connection is required for every ODBC data source name (DSN) for each message flow thread. If a different node on the same thread uses the same DSN, the same connection is used, unless a different transaction mode is used, in which case another connection is required. This is explained further in Database connections for coordinated message flows.

When you start a broker, and while it is running, it opens connections to WebSphere MQ queues and to databases. The broker makes the connections when it needs to use them, and they remain open until:
  • The message flow becomes idle
  • The message flow is stopped
  • The broker is stopped

Database connections from message flows that are not coordinated are released when a flow has no work. For example, a connection is released if there are no messages on a message flow's input queue, and the database has not been accessed for one minute.

On Windows, UNIX and Linux, to avoid breaking coordination, database connections are not released for coordinated message flows.

On z/OS database connections for coordinated message flows are released if the database has not been accessed for one minute.

If you are using the same database for user application data and for broker internal data, add the two connection requirements together when you calculate how many connections are required. For details of broker database connection requirements, see Connecting to the databases.

If you stop the broker, it releases all current database connections.

If you are using DB2 for your database, DB2's default action is to limit the number of concurrent connections to a database to the value of the maxappls configuration parameter. The default for maxappls is 40. If you believe that the connections that the broker might require exceed the value for maxappls, increase this and the associated parameter maxagents to new values based on your calculations.

If you are using another database, check the database documentation for information about connections and limits or restrictions.

When a message flow is idle, the execution group periodically releases database connections. Therefore, connections held by the broker reflect the broker's current use of these resources. This allows the broker to respond to database quiesce, where the database supports quiescing. Not all databases support the quiesce function, and not all databases quiesce in the same way. Check your database documentation for information about database quiescing. Also, see Quiescing a database and Listing database connections that the broker holds for more information.

Related concepts
Message flows overview
Related tasks
Connecting to the databases
Accessing databases from message flows
Configuring coordinated message flows
Related reference
Supported databases
Built-in nodes
User database DBCS restrictions and UNICODE support
Database connections for coordinated message flows
Listing database connections that the broker holds
Quiescing a database
WebSphere MQ connections