HP 3000 Manuals

Ch 5. Transaction Management with Multiple DBEnvironment Connections [ ALLBASE/SQL Release F.0 Application Programming Bulletin for MPE/iX ] MPE/iX 5.0 Documentation


ALLBASE/SQL Release F.0 Application Programming Bulletin for MPE/iX

Chapter 5  Transaction Management with Multiple DBEnvironment Connections 

It is possible to establish a maximum of 32 simultaneous database
connections.  When your application must access more than one
DBEnvironment, there is no need to release one before connecting to
another.  Performance is greatly improved by using this method rather
than connecting to and releasing each DBEnvironment sequentially.

This multi-connect functionality is available in either of two modes.
Single transaction mode allows one transaction at a time to be active in
the currently connected set of DBEnvironments.  Multi-transaction mode 
allows multiple, simultaneous transactions across the currently connected
set of DBEnvironments with a maximum of one active transaction per
connection.  The ALLBASE/SQL Reference Manual contains an introductory
explanation in the "Using Multiple Connections and Transactions with
Timeouts" section of the "Using ALLBASE/SQL" chapter.  Complete syntax is
presented in the "SQL Statements" chapter under SET CONNECTION and SET
MULTITRANSACTION. The present chapter concentrates on application
programming issues.

There are numerous scenarios in which multi-connect functionality could
be useful.  For example, a DBEnvironment maintenance application to be
run in single-user mode might use multiple, nested transactions to select
data from one DBEnvironment, insert it into another, then delete the
selected data from the original DBEnvironment.  Another application of
multi-transaction mode might involve a subroutine that contains a
security audit log transaction.  The subroutine is called from within a
complex transaction whenever a user requests access to data in a
particular table.  Another scenario might be a windows based application
that displays information from several DBEnvironments.  This chapter
presents some general considerations and provides a pseudocode example.
The following topics are addressed:

   *   Preprocessing and Installing Applications.
   *   Understanding Timeouts.
   *   Using Timeouts to Prevent Undetectable Deadlocks.
   *   Using Timeouts to Prevent Infinite Waits.
   *   Using Timeouts to Tune Performance.
   *   Example Using Single-transaction Mode with Timeouts.

Note that although multiple DBEnvironment connections are possible, a
given transaction must require resources from just one DBEnvironment.



MPE/iX 5.0 Documentation