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
3d7079ea
Commit
3d7079ea
authored
Oct 22, 2003
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor, and check we have connection before we try and close it.
parent
2d15f94b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
lib/python/Shared/DC/ZRDB/Connection.py
lib/python/Shared/DC/ZRDB/Connection.py
+9
-12
No files found.
lib/python/Shared/DC/ZRDB/Connection.py
View file @
3d7079ea
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
##############################################################################
##############################################################################
__doc__
=
'''Generic Database Connection Support
__doc__
=
'''Generic Database Connection Support
$Id: Connection.py,v 1.3
6 2003/09/24 14:28:43
chrisw Exp $'''
$Id: Connection.py,v 1.3
7 2003/10/22 20:33:56
chrisw Exp $'''
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
7
$'
[
11
:
-
2
]
import
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
,
Acquisition
,
sys
import
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
,
Acquisition
,
sys
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -142,16 +142,19 @@ class Connection(
...
@@ -142,16 +142,19 @@ class Connection(
manage_main
=
DTMLFile
(
'dtml/connectionStatus'
,
globals
())
manage_main
=
DTMLFile
(
'dtml/connectionStatus'
,
globals
())
def
manage_close_connection
(
self
,
REQUEST
):
def
manage_close_connection
(
self
,
REQUEST
=
None
):
" "
" "
try
:
self
.
_v_database_connection
.
close
()
try
:
if
hasattr
(
self
,
'_v_database_connection'
):
self
.
_v_database_connection
.
close
()
except
:
except
:
LOG
(
'Shared.DC.ZRDB.Connection'
,
LOG
(
'Shared.DC.ZRDB.Connection'
,
ERROR
,
ERROR
,
'Error closing relational database connection.'
,
'Error closing relational database connection.'
,
error
=
exc_info
())
error
=
exc_info
())
self
.
_v_connected
=
''
self
.
_v_connected
=
''
return
self
.
manage_main
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
manage_open_connection
(
self
,
REQUEST
=
None
):
def
manage_open_connection
(
self
,
REQUEST
=
None
):
" "
" "
...
@@ -169,13 +172,7 @@ class Connection(
...
@@ -169,13 +172,7 @@ class Connection(
'''The database connection is not connected'''
)
'''The database connection is not connected'''
)
def
connect
(
self
,
s
):
def
connect
(
self
,
s
):
try
:
self
.
_v_database_connection
.
close
()
self
.
manage_close_connection
()
except
:
LOG
(
'Shared.DC.ZRDB.Connection'
,
ERROR
,
'Error closing relational database connection.'
,
error
=
exc_info
())
self
.
_v_connected
=
''
DB
=
self
.
factory
()
DB
=
self
.
factory
()
try
:
try
:
try
:
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