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
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
ZEO
Commits
50d88b92
Commit
50d88b92
authored
Aug 11, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to switch into a read-only mode if very serious errors
occur.
parent
43766b7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
src/ZODB/Transaction.py
src/ZODB/Transaction.py
+34
-4
No files found.
src/ZODB/Transaction.py
View file @
50d88b92
...
...
@@ -84,15 +84,18 @@
##############################################################################
"""Transaction management
$Id: Transaction.py,v 1.1
3 1999/08/11 13:56:21
jim Exp $"""
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
$Id: Transaction.py,v 1.1
4 1999/08/11 15:20:28
jim Exp $"""
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
import
time
,
sys
,
struct
import
time
,
sys
,
struct
,
POSException
from
struct
import
pack
from
string
import
split
,
strip
,
join
from
zLOG
import
LOG
,
ERROR
from
zLOG
import
LOG
,
ERROR
,
PANIC
from
POSException
import
ConflictError
# Flag indicating whether certain errors have occurred.
hosed
=
0
class
Transaction
:
'Simple transaction objects for single-threaded applications.'
user
=
''
...
...
@@ -200,6 +203,23 @@ class Transaction:
t
=
v
=
tb
=
None
if
(
objects
or
subjars
)
and
hosed
:
# Something really bad happened and we don't
# trust the system state.
raise
POSException
.
TransactionError
,
(
"""A serious error, which was probably a system error,
occurred in a previous database transaction. This
application may be in an invalid state and must be
restarted before database updates can be allowed.
Beware though that if the error was due to a serious
system problem, such as a disk full condition, then
the application may not come up until you deal with
the system problem. See your application log for
information on the error that lead to this problem.
"""
)
try
:
try
:
while
objects
:
...
...
@@ -254,6 +274,16 @@ class Transaction:
try
:
j
.
tpc_finish
(
self
)
# This should never fail
except
:
# Bug if it does, we need to keep track of it and not allow
# any more work without at least a restart!
global
hosed
hosed
=
1
LOG
(
'ZODB'
,
PANIC
,
"An storage error occurred in the last phase of a "
"two-phase commit. This shouldn
\
'
t happen. "
"The application may be in a hosed state, so "
"we will not allow transactions to commit from "
"here on"
,
error
=
sys
.
exc_info
())
if
t
is
None
:
t
,
v
,
tb
=
sys
.
exc_info
()
...
...
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