Results 1 to 6 of 6

Thread: database connections

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    database connections

    how come when I execute the close command from my app, my connection stays open. I've used:


    objcon.close
    objcon.dispose
    objcon = nothing

    when I look in Oracle my connection seems to stay open for about 30 seconds after the close command is executed, then closes...shouldn't they close right away when the close command is executed in the app?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    when I logon I have four separate connections. One to check if the server is running..one to validate userid...another to validate password and another to make sure they are using the right database....is there a way I can do this with one connection in .net?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    with regards to first post......is this part of connection pooling? Where you can use the same connection again and again even tho you may think it has been closed?

    Not exactly sure if this is right so would like to hear what others think???
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  4. #4
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I came across the same thing. The connection will disappear if you close your app right?

    I think it is Connection Pooling. But make sure that you are closing all of your connections. In my case, I did a .open and then used an adapter, which leaves the connection in the state that it was in - and I thought it would close it, but it wasn't. Talk about connections! WOW!

    If you know you will never reuse the connection you can turn pooling off by add the following at the end of your connection string:
    VB Code:
    1. pooling = false

    If you do that then it will dissapear.

  5. #5
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    connection pooling is the way forward!!! It means you don;t have to open 1 connection when the app starts and then close it when it finishes.
    You can open and close the connection as much as you want and the time delay will be minimal.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  6. #6

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    I added pooling=false at the end of my connection string and it gave me another connection


    VB Code:
    1. Dim strconn As String = "Provider=MSDAORA;Password=" & password & ";User ID=" & Name & _
    2.               ";Data Source=" & db & ";pooling=false"
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

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