Close all connection on exit-VBForums
Results 1 to 5 of 5

Thread: Close all connection on exit

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    3

    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)?

  2. #2
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    12,716

    Re: Close all connection on exit

    How are you connecting to the database?
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    3

    Re: Close all connection on exit

    With ADODB connection.

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Candon City, Ilocos Sur, Phils.
    Posts
    10,782

    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.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,193

    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.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.