Was this helpful?
Multiple Resource Manager Instances
An Ingres DTP application server can support multiple resource manager instances (connections to different Ingres databases). Each connection (binding) must be to a different Ingres database. Ingres DTP applications must not issue the Ingres SQL connect statement. Database connections are defined by registering databases using the open string as required by the Transaction Processing software.
To interact with different databases, your application must issue the set connection statement, described in the SQL Reference Guide. For applications that use multiple sessions, service routines must issue the set connection statement at the beginning of the routine (or when resuming a suspended association). This practice ensures that the routine is interacting with the correct resource manager instance.
The following code illustrates the use of multiple resource manager instances in a sample application. In this example, money is transferred from one account to another.
Example: set connection statement
exec sql set connection 'conn1';
exec sql update account
 set balance = balance + :transfer_amount
 where acct = :acct;
exec sql set connection 'conn2';
exec sql update account
 set balance = balance - :transfer_amount
 where acct = :acct;
Note:  To determine whether your TP product supports multiple resource manager instances, refer to your TP vendor documentation. Note that, even if your application does not interact with multiple RMIs, it must issue the set connection statement before attempting to access an RM.
Last modified date: 11/28/2023