PDO Database Connections Problem

Posted by Metropolis on Stack Overflow See other posts from Stack Overflow or by Metropolis
Published on 2010-05-28T19:17:08Z Indexed on 2010/05/28 19:22 UTC
Read the original article Hit count: 295

Filed under:
|
|

Hey Everyone,

Over a year ago I created my own database classes which use PDO, and handle all preparing, executing, and closing connections. These classes have been working great up until now.

There are two different database severs I am grabbing from, MySQL, and MS SQL Express. I am retrieving an employee id from the MySQL server and using it to get that employees information from the MS SQL server. There are about 11k records coming from the MySQL server and my program is only making it through 1200 before crashing with an error like the following.

Connection failed (odbc:Driver=FreeTDS;Servername=MSSQLExpress;Database=SMDINC) Class (PDOException)
SQLSTATE[08001] SQLDriverConnect: 0 [unixODBC][FreeTDS][SQL Server]Unable to connect to data source

It seems like the program is not able to connect to the data source, but it is running the exact same query about 30 times before this and having no problem. Also, I have thoroughly checked all of the data coming into the query and it all looks fine.

I believe the issue may be that there are to many connections being created, but I have tried to close all connections in many different places, and nothing seems to be fixing the problem. Any debugging help, or suggestions would be appreciated!

Craig Metrolis

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql