Re: Transaction persistence between execute() calls
Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | initd.org |
| Message-ID | <[email protected]> |
Il giorno dom, 01/06/2008 alle 19.34 -0300, Clodoaldo ha scritto: > Sorry i didn't tell the whole story. In the example above i placed > everything inside a connection create and a connection.close() to > simplify it. Now i see i need to say that i use a persistent > connection and cursor. So i guess i should somehow mark (begin/commit) > a transaction as the connection isn't started/closed by that request. > Is it right? If so how? As per DBAPI psycopg will implicitly begin a new session when you issue the first query (using .execute()) and commit or abort it when you call conn.commit() or conn.abort(). After you call .commit()/.abort() a new session is begun on the first .execute() and so on. federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer [email protected] INIT.D Developer fog-NGVKUo/i/[email protected] A desobediência é uma virtude necessária à criatividade. -- Raul Seixas _______________________________________________ Psycopg mailing list Psycopg-IAPFreCvJWPBWskQ1e/[email protected] http://lists.initd.org/mailman/listinfo/psycopg
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBIQ7zxvcCgrgZGjesRAheCAJ9MuJBRibUCYKzDGF3c1A/Idmf1PgCfZGIy tJT+KkBZaVep4tyfqG6gGoE= =yOX7 -----END PGP SIGNATURE-----