I'm connecting to a closed-source database called Vertica via unixODBC and
PDO.  Everything is working great but I am having trouble getting
PDO::ATTR_TIMEOUT attribute working when I create a connection via:

$this->conn = new PDO($dsn, $user, $password,
                      array(PDO::ATTR_DEFAULT_FETCH_MODE =>
PDO::FETCH_ASSOC,
                            PDO::ATTR_TIMEOUT => 2));

or

$this->conn->setAttribute(PDO::ATTR_TIMEOUT, 2);

I also found this bug from 2008 (https://bugs.php.net/bug.php?id=45287),
which contains a patch for this issue.  But browsing the php mirror on
github, I don't see this patch applied:
https://github.com/php/php-src/blob/master/ext/pdo_odbc/odbc_driver.c#L339-L352

Does anyone have any experience or advice with how I could implement a
database connection timeout without this patch?  Thanks!

--Rob

Reply via email to