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
Nikola Balog
erp5
Commits
a4a3b7bf
Commit
a4a3b7bf
authored
Aug 16, 2018
by
Julien Muchembled
Committed by
Kazuhiko Shiozaki
Jan 12, 2021
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
8370151d
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 @
a4a3b7bf
...
@@ -82,6 +82,7 @@ from Products.ERP5Type.patches import CachingPolicyManager
...
@@ -82,6 +82,7 @@ from Products.ERP5Type.patches import CachingPolicyManager
from
Products.ERP5Type.patches
import
AcceleratedHTTPCacheManager
from
Products.ERP5Type.patches
import
AcceleratedHTTPCacheManager
from
Products.ERP5Type.patches
import
ExceptionFormatter
from
Products.ERP5Type.patches
import
ExceptionFormatter
from
Products.ERP5Type.patches
import
WebDAV
from
Products.ERP5Type.patches
import
WebDAV
from
Products.ERP5Type.patches
import
ZApplication
from
Products.ERP5Type.patches
import
DTMLMethod
from
Products.ERP5Type.patches
import
DTMLMethod
from
Products.ERP5Type.patches
import
DTMLDocument
from
Products.ERP5Type.patches
import
DTMLDocument
from
Products.ERP5Type.patches
import
CMFCoreUtils
from
Products.ERP5Type.patches
import
CMFCoreUtils
...
...
product/ERP5Type/patches/ZApplication.py
0 → 100644
View file @
a4a3b7bf
##############################################################################
#
# 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