Results 1 to 5 of 5

Thread: Close all connection on exit

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    6

    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
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Close all connection on exit

    How are you connecting to the database?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    6

    Re: Close all connection on exit

    With ADODB connection.

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    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,226

    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
  •  



Click Here to Expand Forum to Full Width