Hi

Before I'll submit errors I found to the collector
I'll be grateful if somebody can take a look at these.

First error is about zope publisher's Retry.
When Retry(...) is called it raises NotFound error instead
of retrying request. Same thing happens with ConflictError
(as it is converted to Retry I think).
In my case this happens while doing 'test' on RDBMS connection (via ZMI)
and when cursor.execute() raises Retry(...).

I'm not sure if this happens always for Retry but I found that Sven
Schomaker has already reported similiar issue:
http://mail.zope.org/pipermail/zope3-dev/2006-July/019814.html

The patch he attached works for me.
I was not able to find this bug submitted on launchpad.
Anybody knows something about this issue? Seems to be
very imporant thing...


Second thing is about zope.rdb:

zope/rdb/__init__.py has function
queryForResults. It's definition is as follows:

def queryForResults(conn, query):
    """Convenience function to quickly execute a query."""

    cursor = conn.cursor()

    try:
        cursor.execute(query)
    except Exception, error:
        # Just catch the exception, so that we can convert it to a database
        # exception.       
        raise DatabaseException(str(error))
    (...)


Line 'except Exception, error:' causes that it has no
sense to raise Retry or Conflict error exceptions from
cursor.execute. But this is necessary...
For example psycopgda raises Retry in it's 'execute'
method when it ecounters conflict or deadlock on database.
Also I'm currently working on cx_Oracle adapter to handle
some oracle errors and I have to raise Retry() in execute function.

Possibly it is enough to change above code to something like:

    try:
        cursor.execute(query)
    except Retry:
        raise
    except ConflictError:
        raise
    except Exception, error:
        # Just catch the exception, so that we can convert it to a database
        # exception.       
        raise DatabaseException(str(error))

Any thoughts?

-- 
Maciej Wisniowski
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to