Validate connection from JDB_InitEnvOvr call

stu

Active Member
Hi All,
We are creating a background login connection using the JDB_InitEnvOvr() E1 function. The purpose of the connection is to launch UBEs under a different login ID other than the current user’s ID. The new background connection is kept open for long periods of time, but in some cases the connection times out (per our 30 minute INI setting). If the program attempts to use the connection, a fatal error is displayed to the user and forces the user to exit the application. Is there any way to validate the user handle / connection generated by the JDB_InitEnvOvr() function call is active before using it?
Attached is the code that is creating the new login connection.
Thanks in advance.
 

Attachments

  • 158688-B5500001.txt
    4.4 KB · Views: 87
I think you can free yourself from all this overhead by initiating the UBE with XML instead. Then you won't need to keep any connections open.

Even without that, why leave the connection open at all? I don't recall it taking more than a couple seconds to start one anyway. Just open one up just before submitting the UBE. Still, I'd do the XML technique, it's much cleaner.
 
Thanks for your response Darren.

The connection is actually used for other purposes other than just submitting UBEs. We use it to gain access to data the logged in user would not have access to (given the logged in role).

The reason we keep it open is because of the performance of the JDB_InitEnvOvr() call - which can take up to 10 seconds to complete in our environment. We are working on improving the performance, but even 3 or 4 seconds is still not acceptible for the requirements.

So given our needs to keep the connection open, I am looking for a method to validate the connection is still active before any logic uses it.
 
Back
Top