Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
erp5
Commits
3ed9c776
Commit
3ed9c776
authored
Sep 05, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suggest a patch to fix an ZODB invalidation bug
Required for mechanize tests, but kept disabled for the moment.
parent
a7893d94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
product/ERP5Type/patches/ZODBConnection.py
product/ERP5Type/patches/ZODBConnection.py
+36
-0
No files found.
product/ERP5Type/patches/ZODBConnection.py
View file @
3ed9c776
...
...
@@ -19,6 +19,8 @@
from
ZODB.Connection
import
Connection
FORCE_STORAGE_SYNC_ON_CONNECTION_OPENING
=
False
if
1
:
# keep indentation. Also good for quick disabling.
def
ping
(
self
):
...
...
@@ -38,3 +40,37 @@ if 1: # keep indentation. Also good for quick disabling.
Connection
.
ping
=
ping
Connection
.
newTransaction
=
newTransaction
# See also neo/client/__init__.py from NEOPPOD project
if
FORCE_STORAGE_SYNC_ON_CONNECTION_OPENING
:
# Whenever an connection is opened (and there's usually an existing one
# in DB pool that can be reused) whereas the transaction is already
# started, we must make sure that proper storage setup is done by
# calling Connection.newTransaction.
# For example, there's no open transaction when a ZPublisher/Publish
# transaction begins.
def
open
(
self
,
*
args
,
**
kw
):
def
_flush_invalidations
():
acquire
=
self
.
_db
.
_a
try
:
self
.
_db
.
_r
()
except
thread
.
error
:
acquire
=
lambda
:
None
try
:
del
self
.
_flush_invalidations
self
.
newTransaction
()
finally
:
acquire
()
self
.
_flush_invalidations
=
_flush_invalidations
self
.
_flush_invalidations
=
_flush_invalidations
try
:
Connection_open
(
self
,
*
args
,
**
kw
)
finally
:
del
self
.
_flush_invalidations
try
:
Connection_open
=
Connection
.
_setDB
Connection
.
_setDB
=
open
except
AttributeError
:
# recent ZODB
Connection_open
=
Connection
.
open
Connection
.
open
=
open
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment