Skip to content
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

Merged
merged 5 commits into from
Apr 7, 2017

Conversation

jensens
Copy link
Member

@jensens jensens commented Apr 5, 2017

@jensens jensens force-pushed the abort-before-close branch from 87c185e to abfd70a Compare April 5, 2017 22:05
@jensens jensens force-pushed the abort-before-close branch from 796fd9c to 45e3a13 Compare April 5, 2017 22:42
@jensens
Copy link
Member Author

jensens commented Apr 5, 2017

Plone coredev uses plone.testing 4.3.x branch at the moment due to test isolation problems (those are caught by 5.0.x).

Copy link

@icemac icemac left a 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.

@@ -543,6 +543,8 @@ def setUpDatabase(self):
self['zodbDB'] = zodb.stackDemoStorage(
self.get('zodbDB'),
name='Startup')
import transaction
Copy link

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.

Copy link
Member Author

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.

@@ -591,6 +593,8 @@ def tearDownDatabase(self):
del self._dbtab

# Close and pop the zodbDB resource
import transaction
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito.

@@ -543,6 +543,8 @@ def setUpDatabase(self):
self['zodbDB'] = zodb.stackDemoStorage(
self.get('zodbDB'),
name='Startup')
import transaction
transaction.begin()
Copy link

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.

Copy link
Member Author

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.

@jensens jensens force-pushed the abort-before-close branch from 45e3a13 to e45e5f1 Compare April 6, 2017 07:14
@jensens
Copy link
Member Author

jensens commented Apr 7, 2017

We are ready with this AFAICT.

@agitator agitator merged commit 28f8991 into master Apr 7, 2017
@agitator agitator deleted the abort-before-close branch April 7, 2017 09:11
@gforcada
Copy link
Member

gforcada commented Apr 7, 2017

Do we really need bootstrap.py anymore?

@jensens
Copy link
Member Author

jensens commented Apr 7, 2017

@gforcada, if you ask me: No. But there are other opinions around stopping me from removing it.

@gforcada
Copy link
Member

gforcada commented Apr 7, 2017

Then let's PLIP it :-) I would like to have some more consistency across the board

@jensens
Copy link
Member Author

jensens commented Apr 7, 2017

@gforcada ok! do you take the initiative to write it? I second it and help were its needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants