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 18.56 -0300, Clodoaldo ha scritto:
> I need that 5 queries fired by the same ajax request to a web python
> application see the same database snapshot and i don't understand how
> exactly to do it. Could it be like this:?

This somehow already happens because the default isolation level is READ
COMMITTED. If you need complete isolation from other queries you can use
serializable:

conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE)

Don't use BEGIN and COMMIT/ABORT in your queries unless you put psycopg
in autocommit mode (but that's something you don't want to do).

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 In science one tries to tell people, in such a way as to be understood
  by everyone, something that no one ever knew before. But in poetry,
  it's the exact opposite.                                 -- Paul Dirac

_______________________________________________
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)

iD8DBQBIQx59vcCgrgZGjesRAlKKAKCn2/OdHXkS8+4wkw3zpZKhKSKsjACgkoiS
KE8o2DOXwMQHZAN7Ug+xYPE=
=dVWV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.