Re: PDO::ATTR_TIMEOUT script specific?

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

 



On Thu, August 2, 2007 1:49 pm, Ken Tozier wrote:
> I have a script that needs to get ad information from two different
> sources, a primary and fallback. The primary source is a high traffic
> (and poorly designed/unpartitioned MSSQL database) with millions of
> records that gets locked up when 'certain folks' (ie executives)
> perform large queries. What I'd like to be able to do is set a
> timeout for a query to this database of 5 to 10 seconds and branch to
> the fallback database if the timeout expires.
>
> I can't just use the fallback as my primary as it doesn't always have
> the most up to date info. It's really only for placeholder queries
> until the primary frees up.
>
> So the question is, does setting PDO::ATTR_TIMEOUT affect all scripts
> or just the one that set the variable?

Two off-the-wall suggestions:

#1. Get the executives to use a super-special "reports" replicated
copy of the database so that they don't take down your entire website
every time they write some stupid ad hoc query.  This is kind of
crucial regardless of how you solve the problem you are having today.

#2. If PDO does NOT do what you need, maybe switch to mssql or sybase
extension driver and use an asynchronous query that you can poll to
see if it has finished or not.  I'm pretty sure these are available in
MSSQL with those drivers, though not 100% sure.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
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