SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Abstract base class from which all custom connection callbacks must derive. More...
#include <rw/db/conncbi.h>
Inherits RWDBReference.
Inherited by RWDBConnDefaultCallbackImp.
Public Member Functions | |
RWDBDatabaseCallback | databaseCallback () const |
RWDBEnvironmentHandle * | environmentHandle () const |
virtual void | postConnAllocate () |
virtual void | postConnect () |
virtual void | preConnAllocate () |
virtual void | preConnDestroy () |
virtual void | preConnect () |
virtual void | preDisconnect () |
void | setError (RWDBStatus::ErrorCode code, const RWCString &message, const RWCString &vendorMessage1=RWCString(), const RWCString &vendorMessage2=RWCString(), long vendorError1=0, long vendorError2=0, bool isTerminal=false, bool invokeErrorHandler=true, bool invalidateConnection=false) |
RWDBStatus | status () const |
RWDBSystemHandle * | systemHandle () const |
Protected Member Functions | |
RWDBConnCallbackImp () | |
RWDBConnCallbackImp is an abstract base implementation class used for implementing connection callbacks. It is reference counted.
You must derive from this class to implement your custom connection callbacks.
This class provides six connection callback methods that you must redefine in your derived class: preConnAllocate(), postConnAllocate(), preConnect(), postConnect(), preDisconnect() and preConnDestroy().
Please refer to the DB Interface Module User's Guide and the applicable DB Access Module User's Guide for more information on these methods.
|
inlineprotected |
The default protected constructor.
RWDBDatabaseCallback RWDBConnCallbackImp::databaseCallback | ( | ) | const |
Returns the RWDBDatabaseCallback associated with the RWDBDatabase object that produced the RWDBConnection object associated with self. If self is not associated with any RWDBConnection object, this callback returns an uninitialized RWDBDatabaseCallback object.
RWDBEnvironmentHandle* RWDBConnCallbackImp::environmentHandle | ( | ) | const |
Returns a pointer to the RWDBEnvironmentHandle of the RWDBDatabase object that produced the RWDBConnection object associated with self. If self is not associated with any RWDBConnection object, returns 0
.
|
virtual |
This callback is invoked just after the allocation of the database-specific connection handle. It is defined as a no-op. To implement it, derive from this class and redefine this method.
|
virtual |
This callback is invoked after establishing the database connection. It is defined as a no-op. To implement it, derive from this class and redefine this method.
|
virtual |
This callback is invoked just before the allocation of the database-specific connection handle. It is defined as a no-op. To implement it, derive from this class and redefine this method.
|
virtual |
This callback is invoked just before the deallocation of the connection handle. It is defined as a no-op. To implement it, derive from this class and redefine this method. This callback is typically called from the destructor of an RWDBConnection object and therefore, you should refrain from throwing an exception.
|
virtual |
This callback is invoked just before establishing the database connection. It is defined as a no-op. To implement it, derive from this class and redefine this method.
|
virtual |
This callback is invoked just before the database connection is closed. It is defined as a no-op. To implement it, derive from this class and redefine this method. This callback is typically called from the destructor of an RWDBConnection object and therefore, you should refrain from throwing an exception.
void RWDBConnCallbackImp::setError | ( | RWDBStatus::ErrorCode | code, |
const RWCString & | message, | ||
const RWCString & | vendorMessage1 = RWCString() , |
||
const RWCString & | vendorMessage2 = RWCString() , |
||
long | vendorError1 = 0 , |
||
long | vendorError2 = 0 , |
||
bool | isTerminal = false , |
||
bool | invokeErrorHandler = true , |
||
bool | invalidateConnection = false |
||
) |
Sets error on self. Optionally, invalidates the RWDBConnection object associated with self.
Parameters code, message, vendorMessage1, vendorMessage2, vendorError1, vendorError2 and isTerminal are RWDBStatus attributes used to set an error on self's RWDBStatus object.
Parameter invokeErrorHandler indicates if the associated error handler should be invoked.
Parameter invalidateConnection indicates whether the RWDBConnection object associated with self should be invalidated. If invalidated, the RWDBConnection object will have an error code of RWDBStatus::applicationError.
|
inline |
Returns the current status of self.
RWDBSystemHandle* RWDBConnCallbackImp::systemHandle | ( | ) | const |
Returns a pointer to the RWDBSystemHandle of the RWDBConnection object associated with self. If self is not associated with any RWDBConnection object, returns 0
.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |