Re: [Sqlalchemy-tickets] [sqlalchemy] #2809: Strange effect with association proxy and event listen
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-29 13:16:52
|
#2809: Strange effect with association proxy and event listener
-----------------------------------+------------------------------------
Reporter: schlamar | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone: 0.8.xx
Component: (none) | Severity: no triage selected yet
Resolution: invalid | Keywords:
Progress State: completed/closed |
-----------------------------------+------------------------------------
Comment (by schlamar):
I'm still not convinced, sorry.
I know that this is a constructed example, but any query to the database
in the event handler will cause the auto flush and therefore cause this
exception (which makes it not such a constructed case). And I know that I
can workaround this issue by wrapping the event handler code into an `with
session.no_autoflush`.
But I see this just as a workaround and not as the solution. I do not
agree that this should be up to the user. IMO sqlalchemy should detect
that it is in an inconsistent state where a flush would (or could) fail
and automatically disable it until you are back in a consistent state.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2809#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|