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
f1610df8
Commit
f1610df8
authored
Jun 29, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the sub argument to subtransaction in commit, abort, and begin.
parent
f35cbeb4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/ZODB/Transaction.py
src/ZODB/Transaction.py
+12
-12
No files found.
src/ZODB/Transaction.py
View file @
f1610df8
...
...
@@ -84,8 +84,8 @@
##############################################################################
"""Transaction management
$Id: Transaction.py,v 1.
8 1999/06/29 18:28:38
jim Exp $"""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
$Id: Transaction.py,v 1.
9 1999/06/29 19:25:25
jim Exp $"""
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
time
,
sys
,
struct
from
struct
import
pack
...
...
@@ -124,7 +124,7 @@ class Transaction:
def
__str__
(
self
):
return
"%.3f
\
t
%s"
%
(
self
.
_id
,
self
.
user
)
def
abort
(
self
,
sub
=
0
,
freeme
=
1
):
def
abort
(
self
,
sub
transaction
=
0
,
freeme
=
1
):
'''Abort the transaction.
This is called from the application. This means that we haven
\
'
t
...
...
@@ -134,7 +134,7 @@ class Transaction:
subj
=
self
.
_sub
subjars
=
()
if
not
sub
:
if
not
sub
transaction
:
if
subj
is
not
None
:
# Abort of top-level transaction after commiting
# subtransactions.
...
...
@@ -160,31 +160,31 @@ class Transaction:
finally
:
tb
=
None
if
sub
:
if
sub
transaction
:
del
self
.
_objects
[:]
# make sure it's empty (shouldn't need)
elif
freeme
:
if
self
.
_id
is
not
None
:
free_transaction
()
else
:
self
.
_init
()
def
begin
(
self
,
sub
=
None
,
info
=
None
):
def
begin
(
self
,
sub
transaction
=
None
,
info
=
None
):
'''Begin a new transaction.
This aborts any transaction in progres.
'''
if
self
.
_objects
:
self
.
abort
(
sub
,
0
)
if
self
.
_objects
:
self
.
abort
(
sub
transaction
,
0
)
if
info
:
info
=
split
(
info
,
'
\
t
'
)
self
.
user
=
strip
(
info
[
0
])
self
.
description
=
strip
(
join
(
info
[
1
:],
'
\
t
'
))
def
commit
(
self
,
sub
=
None
):
def
commit
(
self
,
sub
transaction
=
None
):
'Finalize the transaction'
objects
=
self
.
_objects
jars
=
{}
subj
=
self
.
_sub
subjars
=
()
if
sub
:
if
sub
transaction
:
if
subj
is
None
:
self
.
_sub
=
subj
=
{}
else
:
if
subj
is
not
None
:
...
...
@@ -209,8 +209,8 @@ class Transaction:
i
=
id
(
j
)
if
not
jars
.
has_key
(
i
):
jars
[
i
]
=
j
if
sub
:
subj
[
i
]
=
j
j
.
tpc_begin
(
self
,
sub
)
if
sub
transaction
:
subj
[
i
]
=
j
j
.
tpc_begin
(
self
,
sub
transaction
)
j
.
commit
(
o
,
self
)
del
objects
[
-
1
]
...
...
@@ -259,7 +259,7 @@ class Transaction:
finally
:
tb
=
None
if
sub
:
if
sub
transaction
:
del
self
.
_objects
[:]
# make sure it's empty (shouldn't need)
elif
self
.
_id
is
not
None
:
free_transaction
()
...
...
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