|
|
Re: question about connections, commits, cursors: msg#00003
|
Subject: |
Re: question about connections, commits, cursors |
Hi. How do you configure the number of connections within the pool in Zope?
I'm not using Python code as this thread discusses but am simply using ZSQL methods and a Psycopg connection and would like to investigate the effect of increasing the size of the connection pool for high loads. Is there a global configuration file as there seems to be no setting available in the properties tab.
Thanks, Nick.
On Sun, 2003-11-16 at 11:08, Federico Di Gregorio wrote:
Il dom, 2003-11-16 alle 01:59, Paul Hart ha scritto:
> According to the website, "Every open Python connection keeps a pool of
> real (UNIX or TCP/IP) connections to the database." To me, this means
> that I can open multiple cursors on a single apparent connection.
>
> However, if I'm running in a multithreaded system (which I am; I'm
> building a dynamic website using CherryPy), then I can't use psycopg on
> its own as a connection pool, because a call to connection.commit()
> will commit for all active cursors that have been opened via that
> connection.
if you ask for a non serialized connection object, every cursor will
have it own physical connection to the database. after that you'll be
able to call commit on the cursor.
o = psycopg.connect("dbname=...", serialize=0)
c = o.cursor()
....
c.commit()
note that this feature is deprecated and will go away in psycopg 2.0. it
is much better to use one of the python-only connection pools that can
be found as stand-alone products or inside frameworks like webware or
twisted.
hope this helps,
federico
--
Nick Bower Ph.D.
Cybersecurity Sector
Institute for the Protection and Security of the Citizen
European Commission Joint Research Centre
TP 267
Via Enrico Fermi 1
Ispra
21020 VA
Italy
nicholas.bower-PMsu+bto1Cc@xxxxxxxxxxxxxxxx
tel:+39 0332786679
fax:+39 0332789576
|
_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx
http://lists.initd.org/mailman/listinfo/psycopg
|
| |