The Database communication point enables information to be accessed from or saved to a database. It allows complex database queries to be arbitrarily executed by Rhapsody to insert, update, or modify an existing database.
Supported Operational Modes: Input, Output, Out->In (In->Out is not supported).
The Database communication point only supports one connection when in Input mode. Increasing the number of connections through the Connection tab of the communication point's Properties dialog does not have any effect when using Input mode.
Configuration Properties
The configuration of a Database communication point is flexible and therefore potentially complex. Refer to:
- Database Configuration and Database Component Configuration Reference for details on configuring this communication point's interaction with the database.
- Database Components Best Practice Guide for guidance on the usage of database queries.
To create a new Database communication point:
- Create the Database communication point connection.
Configure the message definition to use for messages processed by this communication point, if required.
Message definitions cannot be used with input Database communication points. Message definitions are only required for output database communication points if the database configuration needs to extract fields within an incoming message.
- Create the database configuration files used within the Rhapsody Engine from the Database Configuration Editor. To launch the Database Configuration Editor, click the Create Configuration link.
Input Mode
A database communication point in input mode is used to poll a database table to detect changes. When changes are detected, the communication point generates one or more XML messages based on the SQL queries configured. These messages are passed into the route for processing. Refer to Properties for XML Message Generation for details.
Rhapsody does not take on responsibility for the query results until they are written to a route. It is recommended that you design queries that return a row at a time (or a small number of rows at a time) with an appropriately structured key value. If the input query returns a large number of rows, the query may be impacted by external factors. Ideally, the query to relate to a single message.
The input polling options for a Database communication point are set using the Database Polling Options dialogue in the Database Configuration Editor. Refer to Database Polling for details.
Additional options which allow some customization of the generated XML message are also available by setting the Configuration Options in the editor.
Input Mode Properties
The properties for the Database communication point in Input mode are as follows:
Property |
Description |
---|---|
Database |
The type of database to connect to:
|
Host |
The hostname/IP address of the database to connect to. This property is only available if Database is not set to |
Port |
The port number to connect to the database. This property is only available if Database is not set to |
Database Name |
The name of the database. If the database selected is This property is only available if Database is not set to |
Username |
The username for database access. This property is only available if Database is not set to |
Password |
The password for database access. This property is only available if Database is not set to |
Additional Connection Properties |
A list of name/value pairs of message properties to be set on the database connection. The listed properties are not used when Database is set to |
Configuration File |
This is an XML file that controls how the communication point interacts with the database. While the XML can be edited manually, the recommended approach is to use the Database Configuration Editor. To launch the Database Configuration Editor, click the Create Configuration link (if a configuration has not yet been created) or the Edit Configuration link (if a configuration exists) in the Configuration File field. Alternatively, to add an existing configuration to a database:
To update the configuration file, click the Edit Configuration link. The Database Configuration Editor is then displayed, which enables you to edit the configuration file. |
Query Timeout |
Use the query timeout option to specify how long, in seconds, a remote operation can take before the procedure times out. The default value is 0. The timeout should be applied to all SQL/procedure queries in the configuration file. It is important to set a suitable timeout to ensure that queries do not block indefinitely as this would manifest as a hang in Rhapsody, which could block either a communication point thread or a route executor thread. Long queries could occur due to one of the following reasons:
|
Socket Timeout | Specifies how long, in seconds, the underlying connection should remain open before timing out. The socket timeout prevents Rhapsody from waiting indefinitely for results from a database in the event Rhapsody loses its connection to the database. A value of zero indicates the timeout is not configured. |
Message Body Column |
Overrides the normal XML message format and uses the specified column as the message body:
|
Output Mode
A database communication point running in Output mode is used to run arbitrary database queries or operations which can be based on data from the incoming message. It is frequently used to insert or update data retrieved from a message.
The properties for the Database communication point in Output mode are similar to those for Input mode, with the following differences:
Property |
Description |
---|---|
Database |
The type of database to connect to:
|
Host |
The hostname/IP address of the database to connect to. This property is only available if Database is not set to |
Port |
The port number to connect to the database. This property is only available if Database is not set to |
Database Name |
The name of the database. If the database selected is This property is only available if the Database is not set to |
Username |
The username for database access. This property is only available if Database is not set to |
Password |
The password for database access. This property is only available if Database is not set to |
Additional connection properties |
A list of name/value pairs of message properties to be set on the database connection. The listed properties are not used when Database is set to |
Configuration File |
An XML file that controls how the communication point interacts with the database. While the XML can be edited manually, the recommended approach is to use the Database Configuration Editor. To launch the Database Configuration Editor, click the Create Configuration link (if a configuration has not yet been created) or the Edit Configuration link (if a configuration exists) in the Configuration File field. Alternatively, to add an existing configuration to a database:
To update the configuration file, click the Edit Configuration link. The Database Configuration Editor is then displayed, which enables you to edit the configuration file. |
Query Timeout |
Used to specify how long, in seconds, a remote operation can take before the procedure times out. The default value is 0. The timeout should be applied to all SQL/procedure queries in the configuration file. It is important to set a suitable timeout to ensure that queries do not block indefinitely as this would manifest as a hang in Rhapsody, which could block either a communication point thread or a route executor thread. Long queries could occur due to one of the following:
|
Socket Timeout | Specifies how long, in seconds, the underlying connection should remain open before timing out. The socket timeout prevents Rhapsody from waiting indefinitely for results from a database in the event Rhapsody loses its connection to the database. A value of zero indicates the timeout is not configured. |
Message Type |
Identifies the output message type when no definition is specified:
|
Definition |
Identifies the message definition used to parse a message. The Database communication point can be configured to build SQL queries based on values retrieved from a message. If this is done, a message definition is required so the message can be parsed. |
Message Errors | Enables the Database communication point to treat message errors as connection errors:
|
Treat Deadlock as Connection Error |
Determines whether a database deadlock is treated as a connection error or as a message error.
This property is disabled if Message Errors is set to |
Treat Query Timeout as Connection Error |
Determines whether a query timeout is treated as a connection error or as a message error.
This property is disabled if Message Errors is set to |
Out->In Mode
The Database communication point in Out->In mode functions in a similar way to Output mode, except the message is returned to the communication point once all queries have completed. When in this mode, the Database communication point operates in a similar manner to the Database Lookup filter. However, it is preferable to use the Database communication point if you are changing the database.
The properties for the Database communication point in Out->In mode are a combination of those described above. Refer to Out->In Properties for general details on a communication point's Out->In modes.