Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
nexedi
ZODB
Commits
d6730dbb
Commit
d6730dbb
authored
Aug 16, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add end_transaction() method.
Use this method to set self._transaction to None and notify another thread.
parent
c67abb1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+12
-13
No files found.
src/ZEO/ClientStorage.py
View file @
d6730dbb
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Network ZODB storage client
$Id: ClientStorage.py,v 1.5
0 2002/08/16 22:49:40
jeremy Exp $
$Id: ClientStorage.py,v 1.5
1 2002/08/16 22:55:44
jeremy Exp $
"""
import
cPickle
...
...
@@ -351,16 +351,21 @@ class ClientStorage:
except
:
# Client may have disconnected during the tpc_begin().
if
self
.
_server
is
not
disconnected_stub
:
self
.
tpc_cond
.
acquire
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
self
.
end_transaction
()
raise
self
.
_serial
=
id
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
def
end_transaction
(
self
):
# the right way to set self._transaction to None
# calls notify() on tpc_cond in case there are waiting threads
self
.
tpc_cond
.
acquire
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
def
tpc_abort
(
self
,
transaction
):
if
transaction
is
not
self
.
_transaction
:
return
...
...
@@ -370,10 +375,7 @@ class ClientStorage:
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
finally
:
self
.
tpc_cond
.
acquire
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
self
.
end_transaction
()
def
tpc_finish
(
self
,
transaction
,
f
=
None
):
if
transaction
is
not
self
.
_transaction
:
...
...
@@ -389,10 +391,7 @@ class ClientStorage:
self
.
_update_cache
()
finally
:
self
.
tpc_cond
.
acquire
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
self
.
end_transaction
()
def
_update_cache
(
self
):
# Iterate over the objects in the transaction buffer and
...
...
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