Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Interface Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

10.3 Callback Classes

The callback classes use the interface-implementation and producer-product patterns used in SourcePro DB.

The following four classes provide the callback framework:

The following class diagram shows part of the structure of the implementation classes.

Figure 5: Callbacks

An instance of the database callback can be supplied in the RWDBDatabase producer method RWDBManager::database(). It accepts an RWDBDatabaseCallback instance and associates the callback with the RWDBDatabase instance produced. The RWDBDatabase object then invokes the callbacks from the RWDBDatabaseCallback instance. When a connection is produced from this RWDBDatabase with no explicit RWDBConnCallback object specified, the connection takes the connection callback produced by the producer method RWDBDatabaseCallback::produceConnCallback().

An instance of the connection callback can be supplied in the RWDBConnection producer method RWDBDatabase::connection(), which takes a custom instance of RWDBConnCallback to associate with this particular connection. This connection will not produce the RWDBConnCallback from the producer method RWDBDatabaseCallback::produceConnCallback(), but instead will use the one supplied. Since this RWDBConnection object has a custom connection callback, the connection will not be fetched from the connection pool nor will it be returned to the connection pool after its use. A new database connection will be produced and it will be destroyed after all references to it go out of scope.

Please refer to the SourcePro C++ API Reference Guide for API details.

The following class diagram explains the relationship between the callback classes and the related database classes.

Figure 6: Class relationship diagram



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.