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
Kirill Smelkov
ZODB
Commits
5d604d32
Commit
5d604d32
authored
Oct 02, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused imports and reorganize import block.
parent
b71f62f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
src/ZODB/Transaction.py
src/ZODB/Transaction.py
+16
-18
No files found.
src/ZODB/Transaction.py
View file @
5d604d32
...
@@ -13,17 +13,16 @@
...
@@ -13,17 +13,16 @@
##############################################################################
##############################################################################
"""Transaction management
"""Transaction management
$Id: Transaction.py,v 1.5
0 2003/10/02 18:17:19
jeremy Exp $
$Id: Transaction.py,v 1.5
1 2003/10/02 20:17:36
jeremy Exp $
"""
"""
import
sys
import
time
,
sys
,
struct
,
POSException
from
string
import
split
,
strip
,
join
from
zLOG
import
LOG
,
ERROR
,
PANIC
,
INFO
,
BLATHER
,
WARNING
from
zLOG
import
LOG
,
ERROR
,
PANIC
,
INFO
,
BLATHER
,
WARNING
from
POSException
import
Conflict
Error
from
ZODB.POSException
import
ConflictError
,
Transaction
Error
from
utils
import
oid_repr
from
ZODB.
utils
import
oid_repr
# Flag indicating whether certain errors have occurred.
# Flag indicating whether certain errors have occurred.
hosed
=
0
hosed
=
0
# There is an order imposed on all jars, based on the storages they
# There is an order imposed on all jars, based on the storages they
# serve, that must be consistent across all applications using the
# serve, that must be consistent across all applications using the
...
@@ -101,7 +100,7 @@ class Transaction:
...
@@ -101,7 +100,7 @@ class Transaction:
entered two-phase commit yet, so no tpc_ messages are sent.
entered two-phase commit yet, so no tpc_ messages are sent.
"""
"""
if
subtransaction
and
(
self
.
_non_st_objects
is
not
None
):
if
subtransaction
and
(
self
.
_non_st_objects
is
not
None
):
raise
POSException
.
TransactionError
,
(
raise
TransactionError
(
"""Attempted to abort a sub-transaction, but a participating
"""Attempted to abort a sub-transaction, but a participating
data manager doesn't support partial abort.
data manager doesn't support partial abort.
"""
)
"""
)
...
@@ -169,9 +168,9 @@ class Transaction:
...
@@ -169,9 +168,9 @@ class Transaction:
if
self
.
_objects
:
if
self
.
_objects
:
self
.
abort
(
subtransaction
,
0
)
self
.
abort
(
subtransaction
,
0
)
if
info
:
if
info
:
info
=
split
(
info
,
'
\
t
'
)
L
=
info
.
split
(
"
\
t
"
)
self
.
user
=
strip
(
info
[
0
]
)
self
.
user
=
L
[
0
].
strip
(
)
self
.
description
=
strip
(
join
(
info
[
1
:],
'
\
t
'
)
)
self
.
description
=
"
\
t
"
.
join
(
L
[
1
:]).
strip
(
)
def
commit
(
self
,
subtransaction
=
None
):
def
commit
(
self
,
subtransaction
=
None
):
"""Finalize the transaction."""
"""Finalize the transaction."""
...
@@ -206,7 +205,7 @@ class Transaction:
...
@@ -206,7 +205,7 @@ class Transaction:
if
(
objects
or
subjars
)
and
hosed
:
if
(
objects
or
subjars
)
and
hosed
:
# Something really bad happened and we don't
# Something really bad happened and we don't
# trust the system state.
# trust the system state.
raise
POSException
.
TransactionError
,
hosed_msg
raise
TransactionError
(
hosed_msg
)
# It's important that:
# It's important that:
#
#
...
@@ -426,18 +425,17 @@ class Transaction:
...
@@ -426,18 +425,17 @@ class Transaction:
def
note
(
self
,
text
):
def
note
(
self
,
text
):
if
self
.
description
:
if
self
.
description
:
self
.
description
=
"%s
\
n
\
n
%s"
%
(
self
.
description
,
strip
(
text
))
self
.
description
=
"%s
\
n
\
n
%s"
%
(
self
.
description
,
test
.
strip
(
))
else
:
else
:
self
.
description
=
strip
(
text
)
self
.
description
=
text
.
strip
(
)
def
setUser
(
self
,
user_name
,
path
=
'/'
):
def
setUser
(
self
,
user_name
,
path
=
'/'
):
self
.
user
=
"%s %s"
%
(
path
,
user_name
)
self
.
user
=
"%s %s"
%
(
path
,
user_name
)
def
setExtendedInfo
(
self
,
name
,
value
):
def
setExtendedInfo
(
self
,
name
,
value
):
ext
=
self
.
_extension
if
self
.
_extension
is
None
:
if
ext
is
None
:
self
.
_extension
=
{}
ext
=
self
.
_extension
=
{}
self
.
_extension
[
name
]
=
value
ext
[
name
]
=
value
hosed_msg
=
\
hosed_msg
=
\
"""A serious error, which was probably a system error,
"""A serious error, which was probably a system error,
...
...
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