Re: Safely timing out DBI queries



And some drivers have a "timeout" parameter that handles this issue at the
vendor API level (e.g. DBD::Sybase's "timeout" parameter that is handled
internally by OpenClient).

Michael





Extranet
chuckfox2@xxxxxxx - 19.09.2006 15:37


To: henri
cc: tyler, darnold, Tim.Bunce, dbi-users, dbi-dev
Subject: Re: Safely timing out DBI queries


I realize that this is very specific to the database, however, it may be
possible to set a resource limit at the database level that will prevent
the queries from consuming too much time.

Chuck

henri@xxxxxxxxxxxxx wrote:
On Sep 18, 2006, at 6:18 PM, Tyler MacDonald wrote:

Dean Arnold <darnold@xxxxxxxxxxxxxx> wrote:
Which brings me back to the notion of non-blocking requests.
Assuming
many/most client libs do support an async capability, and a OOB
cancel, then it should be possible to standardize the behavior
externally.

Attempting to standardize, let alone implement, non-blocking requests
for the current DBI is a far bigger task than the above.

On the other hand, I'd be *delighted* if you, or anyone else, would
like
to champion the work.

<cheap hack>
Start up a thread to handle the request, which sets a state
variable on
the statement handle then the request has been processed?
</cheap hack>

The problem is not to know when a request is done processing.
The problem is killing requests that are processing for too long.
If you want kill them safely, you may not be able to kill them until
they're done, which defeats the purpose.
If you kill them "unsafely", then the Perl interpreter might be in a
dirty state, forcing you to thoroughly dispose of it if you want to be
100% safe.

To kill the requests safely and when you want to, you need
asynchronous support from the database client APIs and drivers, and
quite a bit of standardized support code from DBI.
H



This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.



Relevant Pages

  • Re: What tables do I need
    ... management sample database in Access. ... >> by Topic) of existing data which comprises of of Callers Requests and the ... >> There is no need for any callers details or dates etc... ... >> RequestID (Primary key) Autonumber ...
    (microsoft.public.access.gettingstarted)
  • RE: [Full-Disclosure] Web Application DoS
    ... > product but in several web based applications. ... apps that rely on a database back end. ... it comes to testing production servers. ... hammer it with a zillion requests using a simple script. ...
    (Full-Disclosure)
  • Re: Embedded Database Recommendations?
    ... 1GHz and 1GB RAM. ... Number of concurrent users (access to database) ... Number of SELECT requests per min/per hour... ... so determines how fast a storage unit, ...
    (comp.arch.embedded)
  • Re: A Parable of Two Carpenters
    ... > Internet, ... > segment of the entire distributed database. ... > Also, you could have most of the search software on people's home boxes, ...
    (alt.lang.asm)
  • Re: Perl program and database locked but alive
    ... > I understand it as the script is doing a series of HTTP client requests ... > and does some checks and stores some results to a database ... > in that case it is not a question of database deadlocks the original ... > script you where, look at the last input and so on. ...
    (comp.lang.perl.misc)