logo       

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
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe