Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
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 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Network ZODB storage client
"""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
import
cPickle
...
@@ -351,16 +351,21 @@ class ClientStorage:
...
@@ -351,16 +351,21 @@ class ClientStorage:
except
:
except
:
# Client may have disconnected during the tpc_begin().
# Client may have disconnected during the tpc_begin().
if
self
.
_server
is
not
disconnected_stub
:
if
self
.
_server
is
not
disconnected_stub
:
self
.
tpc_cond
.
acquire
()
self
.
end_transaction
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
raise
raise
self
.
_serial
=
id
self
.
_serial
=
id
self
.
_seriald
.
clear
()
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
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
):
def
tpc_abort
(
self
,
transaction
):
if
transaction
is
not
self
.
_transaction
:
if
transaction
is
not
self
.
_transaction
:
return
return
...
@@ -370,10 +375,7 @@ class ClientStorage:
...
@@ -370,10 +375,7 @@ class ClientStorage:
self
.
_seriald
.
clear
()
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
del
self
.
_serials
[:]
finally
:
finally
:
self
.
tpc_cond
.
acquire
()
self
.
end_transaction
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
def
tpc_finish
(
self
,
transaction
,
f
=
None
):
def
tpc_finish
(
self
,
transaction
,
f
=
None
):
if
transaction
is
not
self
.
_transaction
:
if
transaction
is
not
self
.
_transaction
:
...
@@ -389,10 +391,7 @@ class ClientStorage:
...
@@ -389,10 +391,7 @@ class ClientStorage:
self
.
_update_cache
()
self
.
_update_cache
()
finally
:
finally
:
self
.
tpc_cond
.
acquire
()
self
.
end_transaction
()
self
.
_transaction
=
None
self
.
tpc_cond
.
notify
()
self
.
tpc_cond
.
release
()
def
_update_cache
(
self
):
def
_update_cache
(
self
):
# Iterate over the objects in the transaction buffer and
# 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