Weird stack trace in error_log from PDOException

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

 



Hi,

I have a pretty simple bit of code that looks like the following;

// Prepare a statement. This will actually call a stored procedure
$objStatement = $objDB->prepare($strInsert);

try
{
    $objStatement->execute($arrParams);

    error_log("ABOUT TO fetchColumn");

    $intID = $objStatement->fetchColumn();

    error_log("AFTER fetchColumn");

    $objStatement->closeCursor();
}
catch (PDOException $objEx)
{
    error_log(get_class($objEx));
    // Actually handle the exception
}

The query runs a stored procedure which sometimes results in an
(expected) error condition which the catch block handles. It all works
perfectly, with one exception: Inbetween the call to fetchColumn and the
catch block being invoked, PHP dumps a stack trace to the error log
complaining about the exception, and I can't for the life of me figure
out why or how to stop it. I have the PDO connection configured to throw
exceptions when it encounters and error, and apart from this the code
works perfectly: the exception gets handled and the rest of the code
continues as it should without any other issues.

Does anybody have any thoughts on what might be the cause of the problem
or any pointers on how I could go about debugging it?

Thanks.

-- 

Russ.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux