Salesforce

How to release an AppServer connection from a .NET Open Client

« Go Back

Information

 
TitleHow to release an AppServer connection from a .NET Open Client
URL NameP105348
Article Number000162476
EnvironmentProduct: Progress OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
How to release an AppServer connection from a .NET Open Client

When disposing of an AppObject from a .NET  Open Client, must you also dispose all SubAppObjects and ProcObjects in order to release the Connection?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
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();

 
Workaround
Notes
References to Other Documentation:

Introduction to Open Clients, Build Open Client applications: 
https://docs.progress.com/bundle/openedge-open-clients/page/Build-Open-Client-applications.html

.NET Open Clients, Configure and Deploy .NET Open Client appliclations:
https://docs.progress.com/bundle/openedge-dotnet-open-clients/page/Configure-and-Deploy-.NET-Open-Client-Applications.html
Keyword Phrase
Last Modified Date8/21/2023 6:31 PM

Powered by