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
251aad2f
Commit
251aad2f
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
95448299
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
trunk/src/ZODB/FileStorage.py
trunk/src/ZODB/FileStorage.py
+4
-14
No files found.
trunk/src/ZODB/FileStorage.py
View file @
251aad2f
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# may have a back pointer to a version record or to a non-version
# record.
# record.
#
#
__version__
=
'$Revision: 1.12
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.12
7
$'
[
11
:
-
2
]
import
base64
import
base64
from
cPickle
import
Pickler
,
Unpickler
,
loads
from
cPickle
import
Pickler
,
Unpickler
,
loads
...
@@ -135,7 +135,7 @@ except:
...
@@ -135,7 +135,7 @@ except:
from
ZODB
import
BaseStorage
,
ConflictResolution
,
POSException
from
ZODB
import
BaseStorage
,
ConflictResolution
,
POSException
from
ZODB.POSException
import
UndoError
,
POSKeyError
,
MultipleUndoErrors
from
ZODB.POSException
import
UndoError
,
POSKeyError
,
MultipleUndoErrors
from
ZODB.TimeStamp
import
TimeStamp
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
from
ZODB.utils
import
p64
,
u64
,
cp
,
z64
try
:
try
:
...
@@ -225,18 +225,8 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -225,18 +225,8 @@ class FileStorage(BaseStorage.BaseStorage,
# Lock the database and set up the temp file.
# Lock the database and set up the temp file.
if
not
read_only
:
if
not
read_only
:
try
:
# Create the lock file
f
=
open
(
file_name
+
'.lock'
,
'r+'
)
self
.
_lock_file
=
LockFile
(
file_name
+
'.lock'
)
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
self
.
_tfile
=
open
(
file_name
+
'.tmp'
,
'w+b'
)
self
.
_tfile
=
open
(
file_name
+
'.tmp'
,
'w+b'
)
else
:
else
:
self
.
_tfile
=
None
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