For zope.sqlalchemy I'd like to catch concurrent update errors at
commit time from the database (not the
sqlalchemy.orm.exc.ConcurrentModificationError) and propagate them as
ConflictErrors to Zope's transaction manager so it may retry a
request.
ZPsycopgDA does this for PostgreSQL by looking in the error string
[*]:
except (psycopg2.ProgrammingError,
psycopg2.IntegrityError), e:
if e.args[0].find("concurrent update") > -1:
raise ConflictError
raise e
Would it be possible to abstract this in a database independent manner
so that it could work for other databases too (at least those that
offer MVCC)?
[*] http://www.initd.org/svn/psycopg/psycopg2/trunk/ZPsycopgDA/db.py
Laurence
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---