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_changedhas an undocumentedkeep_sessionkwarg, which defaults toFalsemark_changedis unaware of how the session was registered (i.e. what the user intendedkeep_sessionto be)My first suggestion is to update the docs/readme to point this out.
My second suggestion is to extend the
ZopeTransactionEventsobject to have it's ownjoin_transactionandmark_changedfunctions, which invoke the global ones with the configuredkeep_sessionor anything else.Since
registerreturns 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.