Re: Connection pooling and with statement

From: Frank Broniewski <brfr(at)metrico(dot)lu>
To: psycopg(at)postgresql(dot)org
Subject: Re: Connection pooling and with statement
Date: 2013-08-27 07:13:23
Message-ID: 521C5193.9060106@metrico.lu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Am 2013-08-23 12:03, schrieb Frank Broniewski:
> Another question that occured to me is how I use the with statement with
> the pool class:
>
> I can do:
> with pool.getconn() as conn:
> with conn.cursor() as cursor:
> # do stuff
>
> Where do I need to call pool.putconn(conn)? How does the with statement
> affect the connection? Is the with statement suitable for connection
> pooling at all?

Hey everybody,

I want to come back to my question above. Any ideas on this?

>
> Many thanks,
>
> Frank
>
>

--
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2013-08-27 07:50:15 Re: Connection pooling and with statement
Previous Message Frank Broniewski 2013-08-23 14:45:02 Re: Connection pooling and with statement