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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
e79e888a
Commit
e79e888a
authored
Aug 16, 2018
by
Julien Muchembled
Committed by
Kazuhiko Shiozaki
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zope: make sure that ZODB Connections are closed when ZPublisher has processed a request
parent
387cabc2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+1
-0
product/ERP5Type/patches/ZApplication.py
product/ERP5Type/patches/ZApplication.py
+53
-0
No files found.
product/ERP5Type/ZopePatch.py
View file @
e79e888a
...
...
@@ -82,6 +82,7 @@ from Products.ERP5Type.patches import CachingPolicyManager
from
Products.ERP5Type.patches
import
AcceleratedHTTPCacheManager
from
Products.ERP5Type.patches
import
ExceptionFormatter
from
Products.ERP5Type.patches
import
WebDAV
from
Products.ERP5Type.patches
import
ZApplication
from
Products.ERP5Type.patches
import
DTMLMethod
from
Products.ERP5Type.patches
import
DTMLDocument
from
Products.ERP5Type.patches
import
CMFCoreUtils
...
...
product/ERP5Type/patches/ZApplication.py
0 → 100644
View file @
e79e888a
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
Make sure that ZODB Connections are closed when ZPublisher has processed a request
"""
from
App
import
ZApplication
from
App.ZApplication
import
ZApplicationWrapper
,
connection_open_hooks
if
1
:
def
__bobo_traverse__
(
self
,
REQUEST
=
None
,
name
=
None
):
db
,
aname
=
self
.
_stuff
conn
=
db
.
open
()
if
connection_open_hooks
:
for
hook
in
connection_open_hooks
:
hook
(
conn
)
# arrange for the connection to be closed when the request goes away
request_clear
=
REQUEST
.
clear
def
clear
():
request_clear
()
conn
.
close
()
REQUEST
.
clear
=
clear
conn
.
setDebugInfo
(
REQUEST
.
environ
,
REQUEST
.
other
)
v
=
conn
.
root
()[
aname
]
if
name
is
not
None
:
if
hasattr
(
v
,
'__bobo_traverse__'
):
return
v
.
__bobo_traverse__
(
REQUEST
,
name
)
if
hasattr
(
v
,
name
):
return
getattr
(
v
,
name
)
return
v
[
name
]
return
v
ZApplicationWrapper
.
__bobo_traverse__
=
__bobo_traverse__
del
ZApplication
.
Cleanup
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