IBM Books

Administration Guide


Database Connection Considerations

In a partitioned database, database data can be divided into several database partitions. An application accessing this database connects and sends requests to one of the database partitions. Different applications can connect to different database partitions; and the same application can choose different database partitions for different connections.

If a transaction is completed by multiple applications, all applications must connect to the same database partition in a partitioned database while performing part of this transaction. If XREG requests with the same XID are sent to different partitions in a partitioned database, DB2 will treat them as separate transactions, instead of a single transaction.

If a transaction is completed by multiple transactions, it is important that the database stays up until the transaction is completed. For example problems can occur in the following scenario: a transaction involves two applications A and B, with A disconnecting after performing its portion of the work, and before B connects to the database to complete the transaction. If there is no other connection and the database has not been activated (by the ACTIVATE DATABASE command), the database is shut down before connection by application B starts up the database again. This means the transaction started by A will be rolled back. In a non-partitioned database, the problem described in this scenario can be easily avoided by having application B connect to the database before application A disconnects. However, this solution would not work in a partitioned database. In the above scenario, it is possible that the work performed by application A involves several database partitions that application B has not sent (and will not send) any request to. So the database connection made by application B would not prevent the database being shut down on these database partitions. It is recommended that the ACTIVATE DATABASE command be used to prevent such undesirable behavior. See the Command Reference for more information on ACTIVATE DATABASE.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]