Query Timeout / Subclassing DBI

Query Timeout / Subclassing DBI

am 24.07.2006 22:05:52 von philote

------=_Part_13574_27125282.1153771552974
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I've been trying to find a reliable method for timing out queries that take
too long. I only see a connect timeout in DBI but nothing for timing out a
query. We can't set a timeout on our database either. I've attempted to
use DBIx::DWIW without success.

I'm also trying to subclass DBI and overriding execute to use Sys::SigAction
for the timeout. Everything works, except when the query times out I'm not
sure how to tell DBI an execute took place but no data was returned. So my
subsequent fetch fails, saying execute wasn't called.

Any ideas?

Thanks!

------=_Part_13574_27125282.1153771552974--

Re: Query Timeout / Subclassing DBI

am 24.07.2006 23:28:19 von Tim.Bunce

Without support from the driver and underlying database client library,
timeouts using alarm signals may leave the driver and/or underlying
database client library in an inconsistent state.

Always disconnecting after a timeout may help, but isn't guaranteed.

Tim.

On Mon, Jul 24, 2006 at 04:05:52PM -0400, Kevin Bosak wrote:
> I've been trying to find a reliable method for timing out queries that take
> too long. I only see a connect timeout in DBI but nothing for timing out a
> query. We can't set a timeout on our database either. I've attempted to
> use DBIx::DWIW without success.
>
> I'm also trying to subclass DBI and overriding execute to use Sys::SigAction
> for the timeout. Everything works, except when the query times out I'm not
> sure how to tell DBI an execute took place but no data was returned. So my
> subsequent fetch fails, saying execute wasn't called.
>
> Any ideas?
>
> Thanks!