The AdgConnection class controls database connection resources and allows them to be shared among DataGate objects in your program.
For a list of all members of this type, see AdgConnection Members.
ASNA.DataGate.Client
ASNA.DataGate.Client.AdgConnection
[Prototype in C#] public class AdgConnection | System.ICloneable, System.IDisposable
Any public static (Shared) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
A single instance of AdgConnection should not be shared by multiple threads of an application, unless application access to the instance is protected by a mutual exclusion mechanism, or unpredictable results may occur. For example, an ASP.NET application must take special care when using a shared instance of AdgConnection among multiple ASP.NET sessions. As an alternative, consider using a separate instance of AdgConnection (optionally configured for connection pooling via the PoolingTimeout property of SourceProfile) in each ASP.NET session. Note also that other DCS classes with properties and method parameters of type AdgConnection, such as FileAdapter, may employ the non-thread safe members of AdgConnection internally. By association, instance members of these classes are not guaranteed to be thread safe.
An instance of AdgConnection represents a connection to a database server. The connection is initially in the Closed state, as reflected by the State property. Connection details are described by the SourceProfile property. Connection details are set in AdgConnection at construction and cannot be changed during the lifetime of the object.
Several Open methods are available for transitioning AdgConnection to the Open state. When an AdgConnection object is in the Open state, the values of certain properties reflect the state of a server-side "job". Some job-oriented operations, such as commitment control, can be effected through AdgConnection methods.
An OpenAdgConnection object may enter the Closed state via the Close method. Connections may also be closed via the IDispose.Dispose method. Note that it is the responsibility of the programmer to close database connections. If AdgConnection objects are garbage-collected in the Open state, the resulting state of the underlying connection resources (including network connections) is non-deterministic.
AdgConnection is used by other classes for specific functions such as record access and program call. DataGate objects may hold references to an AdgConnection instance, and those objects may assume that the AdgConnection object is in the Open state. When in the Closed state, the AdgConnection object must not be used by any object which references its database connection, or an exception may occur. Care should be taken not to call methods of DataGate objects which reference AdgConnection objects in the Closed state.
Namespace: ASNA.DataGate.Client
Assembly: ASNA DataGate Client
Platforms: Windows Server 2008 R2, Windows Server 2012, Windows 7, Windows 8 Pro, Windows 8.1 Pro, Windows 10