Close all connection on exit
Hi,
I'm relative new in vb.net programming, so I have some questions.
I have an application that connects to an oracle server to retrieve some records from tables.
Everything is working well. But I would prevent some problems.
Is there a possibility to close all recordsets and the connection to the oracle server, if the computer on which the application is running, is in the LogOff/ShutDown procedure (and the application was not closed), or, for some reason the application is stop working properly (stop responding)?
Re: Close all connection on exit
How are you connecting to the database?
Re: Close all connection on exit
Re: Close all connection on exit
I would suggest instead of ADODB that you will use ADO.Net, and remember the rule of "open as late as possible, close as early as possible" which means you need to open your connection only when you need it and close it again after using it, as such you will not be keeping any connection open.
Re: Close all connection on exit
Another way to achieve this is purely at the database level, where you could CREATE A PROFILE.
Assign this profile to all your users. Then if the user is IDLE for the amount of time specified in the IDLE_TIME parameter, the server will disconnect the user.
This approach does not require any changes to your front-end code. You do need help from the DBA and or system level permissions on the database to achieve this.