PEP 249 - DB API question

k3xji sumerc at gmail.com
Tue Nov 4 15:13:38 EST 2008


> Try spawning a new process to run your query
> in. Use the multiprocessing library. Your main
> application can then just poll the db/query processes
> to see if they're a) finished and b) have a result
>
> Your application server can also c0 kill long running
> queries that are "deemed" to be taking "too long"
> and may not finish (eg: Cartesian Joins).

Just thinking loudly:...

More backward-compatible way to do that is to have a thread
pool of threads running queries and the main pool thread is
polling to see if the child threads are taking too long to
complete? However, from performance point of view this will
be a nightmare? You have a good reason to suggest
multiprocessing, right? But at least I can implement my
critical queries with this kind of design, as they are not
so many.

Good idea, thanks...



More information about the Python-list mailing list