-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix for ZODB 5: Abort transaction before DB close. #30
Conversation
…rt transaction before DB close.
87c185e
to
abfd70a
Compare
796fd9c
to
45e3a13
Compare
Plone coredev uses plone.testing 4.3.x branch at the moment due to test isolation problems (those are caught by 5.0.x). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some comments and questions.
src/plone/testing/z2.py
Outdated
@@ -543,6 +543,8 @@ def setUpDatabase(self): | |||
self['zodbDB'] = zodb.stackDemoStorage( | |||
self.get('zodbDB'), | |||
name='Startup') | |||
import transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think thin import can be moved to the top of the file.
There is already an import from OFS so I am quite sure that transaction
will be available, too when this module is imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just followed the pattern used at other places in the file, I think hence this is not test code but test setup code import in the header is fine. I will change it and remove also the other occurrences.
src/plone/testing/z2.py
Outdated
@@ -591,6 +593,8 @@ def tearDownDatabase(self): | |||
del self._dbtab | |||
|
|||
# Close and pop the zodbDB resource | |||
import transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito.
src/plone/testing/z2.py
Outdated
@@ -543,6 +543,8 @@ def setUpDatabase(self): | |||
self['zodbDB'] = zodb.stackDemoStorage( | |||
self.get('zodbDB'), | |||
name='Startup') | |||
import transaction | |||
transaction.begin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will abort the current transaction if there was already one. I am not sure if this was intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure about it and was not aware it could harm. I remove it.
45e3a13
to
e45e5f1
Compare
We are ready with this AFAICT. |
Do we really need |
@gforcada, if you ask me: No. But there are other opinions around stopping me from removing it. |
Then let's PLIP it :-) I would like to have some more consistency across the board |
@gforcada ok! do you take the initiative to write it? I second it and help were its needed. |
see plone/buildout.coredev#317 (comment)