On Tuesday 13 February 2007 18:29, johnf wrote: > On Tuesday 13 February 2007 17:40, Ed Leafe wrote: > > On Feb 13, 2007, at 8:15 PM, johnf wrote: > > > Yes please do and please take into consideration that psycopg uses > > > connection > > > pooling for every cursor created. > > > > Can you explain that better? In the dbapi, you start with a > > connection object, and from that you get cursors. All cursors created > > from a single connection object share that connection. > > > > Uwe is asking for multiple connection objects. Are you saying that > > if you create multiple connection objects using psycopg, they will > > actually be the same connection underneath? > > > > > > -- Ed Leafe > > -- http://leafe.com > > -- http://dabodev.com > > See my reply to Uwe. I got this from the website: psycopg is different from the other database adapter because it was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a conspicuous number of concurrent INSERTs or UPDATEs. Every open Python connection keeps a pool of real (UNIX or TCP/IP) connections to the database. Every time a new cursor is created, a new connection does not need to be opened; instead one of the unused connections from the pool is used. That makes psycopg very fast in typical client-server applications that create a servicing thread every time a client request arrives.
So as I read above two cursors two connections. -- John Fabiani _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
