GetGlobalConnection Method (IDALService)
- Last UpdatedApr 08, 2026
- 2 minute read
Gets a reference to the global connection to the driver for the given alias-type pair. Before the DAL core returns a reference to the connection object, a status update will be delivered on the connection status callback specified (assuming it isn't null). If the driver is currently connected, a ConnectionEstablishedNotificationMessage message will be delivered. Alternatively, if the connection object is attempting to establish a connection, a OASySDNA.Common.DAL.DALCommon.ConnectionDisconnectedNotificationMessage will instead be delivered. NOTE: All clients in the same process share this same connection, so closing it is problematic. Careful consideration must be used when closing a global connection. A connection should only ever be closed if the connection will never again by any caller in the process for the lifetime of the process. NOTE: The first call your client API is making to this method should include a non-null callback delegate, if you're requesting connection status callbacks. All subsequent calls to the retrieve the same connection object (i.e. call this method with the same driver alias and driver type) should pass in a null callback reference.
IDriverConnection GetGlobalConnection(
string driverAlias,
string driverType,
DALConnectionStatusCallBackMethod connectionCallback
)
IDriverConnection^ GetGlobalConnection(
String^ driverAlias,
String^ driverType,
DALConnectionStatusCallBackMethod^ connectionCallback
)
Parameters
- driverAlias
- The driver alias (e.g. CMX, XIS, HOUCMX)
- driverType
- The driver type (e.g. SQL, PubSub, BLT)
- connectionCallback
- The callback delegate which receives connection status updates and a single connection timeout notification (if any). A null value means that no connection status updates are desired. If the value is not null, it must be a unique callback delegate.
Return Value
a null reference (Nothing in Visual Basic), if there was an error in creating the object, otherwise a DAL connection object.