Re: [Modeling-users] patch that makes saveChanges optional on session destruction in zope
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-06-22 18:40:36
|
John Lenton <jo...@vi...> wrote: > hmm... now I'm not so certain the patch actually did what we > wanted. In fact, reading the code, I see that saveChanges is called > when bind_saveChanges_to_zope_transactions is true, and _finish is > called on the ECProxy. AFAICT, saveChanges is *not* called on session > destruction unless that property is set, and then it is called at > every request end, right? Yes, you're right, except that saveChanges() is in fact *never* called upon session destruction. I did not see what your intent was when I read your message; if you want read-only (ie. no saveChanges() being called on a session's ec), then you simply set bind_saveChanges_to_zope_transactions to false. And you're right, too, about the patch, since it has no effect unless saveChanges() is bound to zope txn, in which case it has the same effect (binding saveChange() to the zope txn). Glad you notice, I did not pay enough attention indeed. Now while we're at it (even if I have no use-case in mind for this): maybe the ability to control independently whether a session's ec should be saved upon session destruction might be useful? -- S=E9bastien. > Sender: John Lenton <jo...@ma...> >=20 > On Sun, Jun 20, 2004 at 05:38:29PM +0200, Sebastien Bigaret wrote: > >=20 > > John Lenton <jo...@vi...> wrote: > > > This patch adds a boolean property to the ZEditingContextSessioning > > > zope product that controls whether saveChanges is called upon session > > > destruction. Defaults to true (i.e., do saveChanges). > > >=20 > > > It's a very simple patch, but it does what we needed (building a web > > > application that needs to ensure atomicity of a complex object that is > > > created in multiple stages). > >=20 > > Thanks for the patch, it will be integrated into the next release. > > Before releasing we'll need to update the documentation at > > ZECSessioning/README and MDL/doc/UserGuide/FrameworkTypicalUsage.tex. > > Email me privately if by any chance you think you could find some time > > for this this week. >=20 > hmm... now I'm not so certain the patch actually did what we > wanted. In fact, reading the code, I see that saveChanges is called > when bind_saveChanges_to_zope_transactions is true, and _finish is > called on the ECProxy. AFAICT, saveChanges is *not* called on session > destruction unless that property is set, and then it is called at > every request end, right? >=20 > Pass me the paper bag :( |