After several hours of debugging, I finally solved a SqlAlchemy issue:
mark_changed has an undocumented keep_session kwarg, which defaults to False
mark_changed is unaware of how the session was registered (i.e. what the user intended keep_session to be)
My first suggestion is to update the docs/readme to point this out.
My second suggestion is to extend the ZopeTransactionEvents object to have it's own join_transaction and mark_changed functions, which invoke the global ones with the configured keep_session or anything else.
Since register returns the configured extension, this would allow a developer to invoke ext.mark_changed(dbSession) and preserve the value of keep_session. I'd be happy to generate a PR for this.
After several hours of debugging, I finally solved a SqlAlchemy issue:
mark_changed
has an undocumentedkeep_session
kwarg, which defaults toFalse
mark_changed
is unaware of how the session was registered (i.e. what the user intendedkeep_session
to be)My first suggestion is to update the docs/readme to point this out.
My second suggestion is to extend the
ZopeTransactionEvents
object to have it's ownjoin_transaction
andmark_changed
functions, which invoke the global ones with the configuredkeep_session
or anything else.Since
register
returns the configured extension, this would allow a developer to invokeext.mark_changed(dbSession)
and preserve the value ofkeep_session
. I'd be happy to generate a PR for this.