-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransactionalUndo closes storages it opens. #269
Conversation
Any interested reviewers? |
I realized we should really be It would be nice to get this merged and the rest of the changes in master released. |
Are you sure relstorage needs things to be done when allocating/freeing instances for undos ? I mean: relstorage does not implement undo_instance and mvccstorage does not nothing for undo instances. If relstorage could implement undo_instance() in such a way calling release would not be needed, the ZODB code would be simpler. |
Yes. RelStorage implements
I suppose that's true, but I'm not particularly a fan of that for a few different reasons:
|
Fixes #268.
Additionally, it no longer eagerly opens the new instance, waiting until it actually needs it, and disposes of it (not just closes it) when it is done, thus breaking the reference cycle outlined in #268.
I did the closing in both
tpc_finish
andtpc_abort
because one or the other of those (logically) must be called oncetpc_begin
was called. In the implementation oftransaction
, it looks like the plainabort()
method is also always called, but the docs don't make it clear that that's required (in fact, they say thatabort
"may also be called").