FAQ
Hello,

I have updated ZPsycopgDA add/edit screens to include all of the
isolation levels provided by psycopg2. It seems that even the ones
that were there had the wrong mappings between the isolation level
name and the internal integer identifier. "Read Commited" in the drop
down was actually mapping to "Read Uncommited" and "Serializable" was
mapping to "Read Committed".

I have attached a diff of my changes, if there is a way for me to
git push my changes where someone with write access can pull from I
can do that too.

Thanks,

Lex

Search Discussions

  • Daniele Varrazzo at Aug 9, 2011 at 3:23 pm

    2011/8/9 Lex Berezhny <eukreign@gmail.com>:
    Hello,

    I have updated ZPsycopgDA add/edit screens to include all of the
    isolation levels provided by psycopg2. It seems that even the ones
    that were there had the wrong mappings between the isolation level
    name and the internal integer identifier. "Read Commited" in the drop
    down was actually mapping to "Read Uncommited" and "Serializable" was
    mapping to "Read Committed".
    I'm not entirely sure Autocommit should be included in the list: it
    isn't exactly a transaction isolation level. But I know little about
    Zope so I may be wrong.
    I have attached a diff of my changes, if there is a way for me to
    git push my changes where someone with write access can pull from I
    can do that too.
    You may have a clone on github. I have my repos there and Federico
    usually pulls my code from it.

    -- Daniele
  • Federico Di Gregorio at Aug 9, 2011 at 3:54 pm

    On 09/08/11 17:23, Daniele Varrazzo wrote:
    2011/8/9 Lex Berezhny <eukreign@gmail.com>:
    Hello,

    I have updated ZPsycopgDA add/edit screens to include all of the
    isolation levels provided by psycopg2. It seems that even the ones
    that were there had the wrong mappings between the isolation level
    name and the internal integer identifier. "Read Commited" in the drop
    down was actually mapping to "Read Uncommited" and "Serializable" was
    mapping to "Read Committed".
    I'm not entirely sure Autocommit should be included in the list: it
    isn't exactly a transaction isolation level. But I know little about
    Zope so I may be wrong.
    IMO, autocommit should not be included. Zope has the concept of "page
    transaction" and we don't want to break that.
    I have attached a diff of my changes, if there is a way for me to
    git push my changes where someone with write access can pull from I
    can do that too.
    You may have a clone on github. I have my repos there and Federico
    usually pulls my code from it.
    Yep, just send to me or to this list a pull request.

    federico

    --
    Federico Di Gregorio federico.digregorio@dndg.it
    Studio Associato Di Nunzio e Di Gregorio http://dndg.it
    Se consideri l'uso del software libero una concessione tu stesso,
    come potrai proporla agli altri? -- Nick Name
  • Lex Berezhny at Aug 9, 2011 at 6:16 pm
    Hi,

    We have a pretty large Zope application that completely stopped
    working (no transactions were being commited) after upgrading from
    psycopg 2.4.1 to 2.4.2.

    When I create the ZPsycopgDA adapter in the ZMI using Autocommit (via
    the patch I submitted) as the Isolation Level it starts working again.

    I think it would be useful to have all of the available isolation
    levels in the drop down since they are all described in the API.

    In our case, our application doesn't work at all without Autocommit.
    ZSQL methods never commit. Even when using the database adapter "Test"
    tab to run ad hoc queries all of them rollback.

    I have added my change to github but couldn't figure out how to
    generate a pull request so here is a link to the commit, let me know
    if you need anything else from me:

    https://github.com/eukreign/psycopg2/commit/fde7d5e019fbe119bb696ee7c7dafc12569a02f4

    Right now, Autocommit is the default option when adding the database
    adapater (because it's the first one in the API as well). If you would
    rather have something else I can change it and resubmit.

    Thanks a lot,

    Lex
  • Federico Di Gregorio at Aug 9, 2011 at 6:38 pm

    On 09/08/11 20:16, Lex Berezhny wrote:
    Hi,

    We have a pretty large Zope application that completely stopped
    working (no transactions were being commited) after upgrading from
    psycopg 2.4.1 to 2.4.2.

    When I create the ZPsycopgDA adapter in the ZMI using Autocommit (via
    the patch I submitted) as the Isolation Level it starts working again.

    I think it would be useful to have all of the available isolation
    levels in the drop down since they are all described in the API.

    In our case, our application doesn't work at all without Autocommit.
    ZSQL methods never commit. Even when using the database adapter "Test"
    tab to run ad hoc queries all of them rollback.
    So, you're saying that psycopg 2.4.2 is broken (vs Zope) and that the
    right way to fix it is to add autocommit (i.e., if the page fails your
    changes are committed to the database anyway). I'm, not sure I like
    that. ;) We'll try to fix the Zope problem before 2.4.3 release.

    In the meantime, thanks for the patch.

    federico

    --
    Federico Di Gregorio federico.digregorio@dndg.it
    Studio Associato Di Nunzio e Di Gregorio http://dndg.it
    Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare
    i `domani'. -- Haruki Murakami
  • Karsten Hilbert at Aug 9, 2011 at 7:39 pm

    On Tue, Aug 09, 2011 at 02:16:39PM -0400, Lex Berezhny wrote:

    I think it would be useful to have all of the available isolation
    levels in the drop down since they are all described in the API.
    You are correct !

    The only problem with this: An isolation level "autocommit"
    does not exist.

    Karsten
    --
    GPG key ID E4071346 @ gpg-keyserver.de
    E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
  • Daniele Varrazzo at Aug 10, 2011 at 10:04 am

    On Tue, Aug 9, 2011 at 7:16 PM, Lex Berezhny wrote:

    We have a pretty large Zope application that completely stopped
    working (no transactions were being commited) after upgrading from
    psycopg 2.4.1 to 2.4.2.
    Well, this was not supposed to happen! The semantics regarding the
    isolation level was not supposed to change in the refactoring released
    in 2.4.2.

    If you could investigate a little more in what changed between the
    releases, in terms of communication between the application and the
    database, it would be great. It may be helpful to bump up the level in
    the database log (log_statement = 'all' in postgres.conf) to see the
    sequence of commands received.

    Thank you very much.

    -- Daniele
  • Lex Berezhny at Aug 10, 2011 at 1:51 pm

    On Wed, Aug 10, 2011 at 6:04 AM, Daniele Varrazzo wrote:
    If you could investigate a little more in what changed between the
    releases, in terms of communication between the application and the
    database, it would be great. It may be helpful to bump up the level in
    the database log (log_statement = 'all' in postgres.conf) to see the
    sequence of commands received.
    In all cases, even in the "Test" tab of the adapter in the ZMI
    entering queries immediately results in "rollback" being issued as
    well.

    - lex

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppsycopg @
categoriespostgresql, python
postedAug 9, '11 at 3:13p
activeAug 10, '11 at 1:51p
posts8
users4
websiteinitd.org...
irc#postgresql

People

Translate

site design / logo © 2017 Grokbase