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
7d4716e8
Commit
7d4716e8
authored
Feb 28, 2003
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported from ZODB4, use the lock_file.LockFile class to
encapsulation the storage lock file.
parent
da536f0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+4
-14
No files found.
src/ZODB/FileStorage.py
View file @
7d4716e8
...
...
@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__
=
'$Revision: 1.12
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.12
7
$'
[
11
:
-
2
]
import
base64
from
cPickle
import
Pickler
,
Unpickler
,
loads
...
...
@@ -135,7 +135,7 @@ except:
from
ZODB
import
BaseStorage
,
ConflictResolution
,
POSException
from
ZODB.POSException
import
UndoError
,
POSKeyError
,
MultipleUndoErrors
from
ZODB.TimeStamp
import
TimeStamp
from
ZODB.lock_file
import
lock_f
ile
from
ZODB.lock_file
import
LockF
ile
from
ZODB.utils
import
p64
,
u64
,
cp
,
z64
try
:
...
...
@@ -225,18 +225,8 @@ class FileStorage(BaseStorage.BaseStorage,
# Lock the database and set up the temp file.
if
not
read_only
:
try
:
f
=
open
(
file_name
+
'.lock'
,
'r+'
)
except
:
f
=
open
(
file_name
+
'.lock'
,
'w+'
)
lock_file
(
f
)
try
:
f
.
write
(
str
(
os
.
getpid
()))
f
.
flush
()
except
:
pass
self
.
_lock_file
=
f
# so it stays open
# Create the lock file
self
.
_lock_file
=
LockFile
(
file_name
+
'.lock'
)
self
.
_tfile
=
open
(
file_name
+
'.tmp'
,
'w+b'
)
else
:
self
.
_tfile
=
None
...
...
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