Data Transformation Engine Services Guide

Chapter 17 Calling Interface for Functions
107
The function has the prototype:
void CompareConnections ( EXITPARAM *lpep );
where:
DwSize The size of EXITPARAM to assure correct compatibility.
Lpv Used as input, contains the adapter specific parameter block of the new connection
bCleanup Used as input, non-zero (TRUE) means that the connection corresponding the adapter’s parameters passed
in lpAdaptParms is currently being used by this map. 0 (FALSE) means that the connection is not currently
being used by a map. Note that a connection will never be used by more than one map concurrently, but can
be used by multiple cards or rules within a map.
nReturn Used as output, 0 (FALSE) means the connections do not match, non-zero (TRUE) means that they do
match.
lpAdaptParms Used as input, contains the adapter specific parameter block of the existing connection
The function simply compares those elements in the adapter parms structure that
constitute the connection parameters. Typically the rollback and transaction scope
parameters will factor into the decision as to whether connections may be shared.
Validate Connection Command
This function is called by the Resource Manager to see whether an existing connection is
still alive. For some resources, if a connection is left unused for a duration the
connection will expire (for example, FTP). The resource manager may call this function
prior to reusing the connection. The adapter should do some operation utilizing the
connection that is benign and quick, just to validate whether the connection is alive. If
the adapter determines that the connection has expired, it should proceed to clean up
since it will never be called again on this connection. The Resource Manager will then
free up the thread and discard any knowledge of this connection.
The Resource Manager may, if it chooses, call this function to keep a connection alive,
since any activity on the connection will refresh the inactivity timeout.
The function has the prototype:-
void ValidateConnection ( EXITPARAM *lpep );
where:
DwSize The size of EXITPARAM to assure correct compatibility.
Bcleanup Used as output, non-zero (TRUE) means that the connection has expired and the adapter has freed up its
resources. If the connection is still alive, the adapter should return 0 (FALSE)
NReturn Used as output, 0 means the connection is valid, a non-zero value means it is invalid
szErrMsg Used as output, contains the string message based on nReturn.
szFile Not used.
lpInternal Not currently used.
lpCmdStruct Not used.
lpAdaptParms Used as input, contains the adapter specific parameter block of the existing connection
lpContext Used as input, contains the adapter specific context structure containing handles etc for the open connection
Free Adapter Parameters Command
This function is called by the Resource Manager to free up the memory allocated by an
adapter’s ‘Validate Command’ function. Since only the adapter knows the contents of
this structure, only it can free up the memory used by or pointed to by this structure.
The function has the prototype:
void FreeAdapterParms ( EXITPARAM *lpep );