.net open client - make sessionpool thread safe

Status
Not open for further replies.
U

ujj1

Guest
Recently encountered a thread safety issue with the way Progress Openedge maintains its list of connection to the appserver broker. Got a simple case going and logged it with Progress Tech support (case: 00262569). They were able to reproduce the issue and provide a workaround. The workaround is to make sure to lock the code that creates the Connection object so that only one thread accesses that at a time. Also make sure that the appobject creation that uses the connection object also has thread safe access around it. Also contrary to the documentation, don't Dispose the AppObject or call ReleaseConnections on the Connection object. This is only the case where you are sharing the same Connection object with multiple AppObjects using the SessionFree model. The enhancement request is to make the AppObject/Connection management code in the .net open client (and java open client) libraries thread safe. In the example that I found, my application was not properly disconnecting from the state-free appserver which ended up by chewing up broker connections causing no more customers to log onto the system. Not good! Either the underlying dotnet code should be made thread safe or update the documentation to properly document how to interface with the Progress supplied classes. Something like the following seems to work in the simple case but has not been extensively tested. private static Connection connection = null; private static _lockObject = new object(); ... some method later: if (connection == null) { lock(_lockObject) { connection = new Connection(...); } } Also lock the construction of the AppObject that uses the connection. private static object _lockAppObject = new object(); ... lock (_lockAppObject) { appobject = new MyAppObjectFromProxyGen(connection); }

Continue reading...
 
Status
Not open for further replies.
Top