Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    15

    Unanswered: Connection pooling in ADO

    When i run this

    sp_who


    I see the connection showing up and in the next second it is gone.


    The connectionstring i have is


    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
    Info=False;pooling=true;Min Pool Size=2;Max Pool Size=50;Connection
    Lifetime=120;Initial Catalog=test;Data Source=TESTMACHINE\SQLEXPRESS;


    And then in the log, the log grows almost every second 3 entiries !!
    "Login succeeded for user 'TESTMACHINE\User'. Connection: trusted...."
    "Login succeeded for user 'TESTMACHINE\User'. Connection: trusted...."
    "Login succeeded for user 'TESTMACHINE\User'. Connection: trusted...."


    So the problem is that pooling does not seem to work. I dont see any
    connections being held for more than 1 second

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Have you tried the following?
    try {
    conn.ConnectionString = "...Connect Timeout=1..."
    conn.Open()
    }
    catch (Exception) {
    if <connection_open> conn.Close()
    conn.ConnectionString = "...Connect Timeout=30..."
    ...}

    If your connect process takes longer than 1 second than your connection pooling is not working as expected.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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