On 16/05/11 14:03 +0200, Bertrand Chenal wrote: > Le Mon, 16 May 2011 13:26:06 +0200, > Cédric Krier <[email protected]> a écrit : > > So after re-reading the psycopg2 doc [1], I could create a thread per > > query and read the result after which will allow parallelisation of > > the queries and will improve the performences. > > It seems that it's not necessary to create new threads (at least for > postgresql). If I understand the doc[1] correctly you can use select[2] > on DB connection. > > Maybe it would possible to use async call for _all_ the queries, and > then offer concurrent access using only one process and no thread :D
This technics only work with autocommit transaction which can not be used in Tryton. > [1] > http://initd.org/psycopg/docs/advanced.html#asynchronous-notifications > & > http://initd.org/psycopg/docs/advanced.html#support-to-coroutine-libraries > [2] http://docs.python.org/library/select.html -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpSpuBuefDLC.pgp
Description: PGP signature
