When the .NET proxy uses only an
AppObject (i.e. no SubAppObjects or ProcObjects), using the dispose() method of the AppObject is sufficient to release the connection to the AppServer.
When either
SubAppObjects or
ProcObjects are used, those objects must have their dispose() methods called to release them before the AppObject has its dispose() method called. If you do not call dispose() for all SubAppObjects and ProcObjects the connection to the AppServer will not be released.
Please note that the ReleaseConnection() method of the Connection object is used to release the Connection objects reference to the connection pool itself. It should be called when you want the entire connection pool to be removed.
Example of C# code:
// Connect to the AppServer using the AppObject
MyAppObject vAppServer = new MyAppObject(vConnectionObject);
// Instantiate Persistent procedure on the AppServer (Retain Object Reference)
MyProcObject vPersistentProcedure = vAppServer.CreatePO_SomePersistentProcedure();
// Call Internal Procedure within Persistent Procedure
vPersistentProcedure.SomeInternalProcedure();
// Instantiate SubAppObject defined within AppObject (i.e. Proxy)
MySubAppObject vSubAppObject = vAppServer.CreateAO_SubAppObject();
// Required. Dispose of Instantiated SubAppObject
vSubAppObject.Dispose();
// Required. Dispose of Instantiated Persistent Procedure
vPersistentProcedure.Dispose();
// Required. Dispose of Instantiated AppObject (Connection to AppServer is now Released)
vAppServer.Dispose();