Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
795e7e59
Commit
795e7e59
authored
Sep 24, 2003
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed some bare try: except:'s in Shared.DC.ZRDB.Connection
so that they now log exceptions that occur.
parent
c6446fe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Shared/DC/ZRDB/Connection.py
lib/python/Shared/DC/ZRDB/Connection.py
+19
-5
No files found.
doc/CHANGES.txt
View file @
795e7e59
...
...
@@ -18,6 +18,9 @@ Zope Changes
- Collector #1039: Whitespace problem in Z2.log fixed
- changed some bare try: except:'s in Shared.DC.ZRDB.Connection
so that they now log exceptions that occur.
2.7.0b2
Features added
...
...
lib/python/Shared/DC/ZRDB/Connection.py
View file @
795e7e59
...
...
@@ -12,8 +12,8 @@
##############################################################################
__doc__
=
'''Generic Database Connection Support
$Id: Connection.py,v 1.3
5 2002/08/14 21:50:59 mj
Exp $'''
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
$Id: Connection.py,v 1.3
6 2003/09/24 14:28:43 chrisw
Exp $'''
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
,
Acquisition
,
sys
from
DateTime
import
DateTime
...
...
@@ -23,6 +23,8 @@ from string import find, join, split
from
Aqueduct
import
custom_default_report
from
cStringIO
import
StringIO
from
Results
import
Results
from
sys
import
exc_info
from
zLOG
import
LOG
,
ERROR
import
DocumentTemplate
,
RDB
class
Connection
(
...
...
@@ -63,7 +65,11 @@ class Connection(
Globals
.
Persistent
.
__setstate__
(
self
,
state
)
if
self
.
connection_string
:
try
:
self
.
connect
(
self
.
connection_string
)
except
:
pass
except
:
LOG
(
'Shared.DC.ZRDB.Connection'
,
ERROR
,
'Error connecting to relational database.'
,
error
=
exc_info
())
def
title_and_id
(
self
):
s
=
Connection
.
inheritedAttribute
(
'title_and_id'
)(
self
)
...
...
@@ -139,7 +145,11 @@ class Connection(
def
manage_close_connection
(
self
,
REQUEST
):
" "
try
:
self
.
_v_database_connection
.
close
()
except
:
pass
except
:
LOG
(
'Shared.DC.ZRDB.Connection'
,
ERROR
,
'Error closing relational database connection.'
,
error
=
exc_info
())
self
.
_v_connected
=
''
return
self
.
manage_main
(
self
,
REQUEST
)
...
...
@@ -160,7 +170,11 @@ class Connection(
def
connect
(
self
,
s
):
try
:
self
.
_v_database_connection
.
close
()
except
:
pass
except
:
LOG
(
'Shared.DC.ZRDB.Connection'
,
ERROR
,
'Error closing relational database connection.'
,
error
=
exc_info
())
self
.
_v_connected
=
''
DB
=
self
.
factory
()
try
:
...
...
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