ADO leaving "Sleeping connections"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When I run my application under a load test, ~1,800 connections are left in a Sleeping status (using the Stored Procedure, sp_who, reveals this). This causes the application to hang. After leaving the SQL Server rest for several minutes, the connections are restored and the application can run. Has anyone ever experienced this problem?

This is my test script:

  $dbh = db_open($dbserver, $user, $password, $database);
  if ($dbh) {
    echo "Connected to " . $dbserver . "<br>";
    echo "Opened database " . $database . "<br>";
    $row = db_find_case_all($dbh, "***");
    if ($row) {
      while(!$row->EOF) {
        $ca_casename = $row->Fields["CA_NAME"]->Value;
        $ca_casecode = $row->Fields["CA_CODE"]->Value;
        echo $ca_casecode . " " . $ca_casename . "<br>";
        $row->movenext();
      }
    } else {
      echo "There are no cases<br>";
    }
  } else {
    echo "Cannot connect to " . $dbserver;
  }
  if ($row){
    $row->Close();
    $row = null;
  }
  if ($dbh) {
    $dbh->Close();
    $dbh = null;
  }

  if (!$dbh)
    echo "Connection closed<br>";
  else
    echo "Connection still open<br>";

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux