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
4ebc9555
Commit
4ebc9555
authored
May 24, 2000
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged the Mount-Dev branch into the main trunk.
parent
2ef8c745
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
330 additions
and
8 deletions
+330
-8
src/ZODB/Connection.py
src/ZODB/Connection.py
+17
-2
src/ZODB/Mount.py
src/ZODB/Mount.py
+295
-0
src/ZODB/POSException.py
src/ZODB/POSException.py
+7
-4
src/ZODB/coptimizations.c
src/ZODB/coptimizations.c
+11
-2
No files found.
src/ZODB/Connection.py
View file @
4ebc9555
...
...
@@ -84,8 +84,8 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.3
3 2000/05/20 15:54:28 jim
Exp $"""
__version__
=
'$Revision: 1.3
3
$'
[
11
:
-
2
]
$Id: Connection.py,v 1.3
4 2000/05/24 20:53:34 shane
Exp $"""
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
from
cPickleCache
import
PickleCache
from
POSException
import
ConflictError
,
ExportError
...
...
@@ -115,6 +115,9 @@ class Connection(ExportImport.ExportImport):
_debug_info
=
()
_opened
=
None
# Experimental. Other connections can register to be closed
# when we close by putting something here.
def
__init__
(
self
,
version
=
''
,
cache_size
=
400
,
cache_deactivate_after
=
60
):
"""Create a new Connection"""
...
...
@@ -232,6 +235,10 @@ class Connection(ExportImport.ExportImport):
def
cacheFullSweep
(
self
,
dt
=
0
):
self
.
_cache
.
full_sweep
(
dt
)
def
cacheMinimize
(
self
,
dt
=
0
):
self
.
_cache
.
minimize
(
dt
)
__onCloseCallbacks
=
()
def
onCloseCallback
(
self
,
f
):
self
.
__onCloseCallbacks
=
self
.
__onCloseCallbacks
+
(
f
,)
def
close
(
self
):
self
.
_incrgc
()
# This is a good time to do some GC
db
=
self
.
_db
...
...
@@ -239,6 +246,14 @@ class Connection(ExportImport.ExportImport):
self
.
_debug_info
=
()
db
.
_closeConnection
(
self
)
# Call the close callback
for
f
in
self
.
__onCloseCallbacks
:
try
:
f
()
except
:
f
=
getattr
(
f
,
'im_self'
,
f
)
LOG
(
'ZODB'
,
ERROR
,
'Close callback failed for %s'
%
f
)
self
.
__onCloseCallbacks
=
()
def
commit
(
self
,
object
,
transaction
,
_type
=
type
,
_st
=
type
(
''
)):
oid
=
object
.
_p_oid
invalid
=
self
.
_invalid
...
...
src/ZODB/Mount.py
0 → 100644
View file @
4ebc9555
This diff is collapsed.
Click to expand it.
src/ZODB/POSException.py
View file @
4ebc9555
...
...
@@ -84,8 +84,8 @@
##############################################################################
'''BoboPOS-defined exceptions
$Id: POSException.py,v 1.
4 2000/05/17 19:45:18 jim
Exp $'''
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
$Id: POSException.py,v 1.
5 2000/05/24 20:53:34 shane
Exp $'''
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
class
POSError
(
Exception
):
...
...
@@ -129,6 +129,10 @@ class StorageSystemError(StorageError):
"""Panic! Internal storage error!
"""
class
MountedStorageError
(
StorageError
):
"""Unable to access mounted storage.
"""
class
ExportError
(
POSError
):
"""An export file doesn't have the right format.
"""
...
...
@@ -142,7 +146,7 @@ class Unimplemented(POSError):
class
Unsupported
(
POSError
):
"""An feature that is unsupported bt the storage was used.
"""
class
InvalidObjectReference
(
POSError
):
"""An object contains an invalid reference to another object.
...
...
@@ -152,4 +156,3 @@ class InvalidObjectReference(POSError):
o A reference to an object in a different database connection.
"""
src/ZODB/coptimizations.c
View file @
4ebc9555
...
...
@@ -189,7 +189,16 @@ persistent_id_call(persistent_id *self, PyObject *args, PyObject *kwargs)
if oid is None or object._p_jar is not self:
*/
if
(
oid
!=
Py_None
)
UNLESS
(
jar
=
PyObject_GetAttr
(
object
,
py__p_jar
))
PyErr_Clear
();
{
UNLESS
(
jar
=
PyObject_GetAttr
(
object
,
py__p_jar
))
PyErr_Clear
();
if
(
jar
&&
jar
!=
Py_None
&&
jar
!=
self
->
jar
)
{
PyErr_SetString
(
InvalidObjectReference
,
"Attempt to store an object from a foreign "
"database connection"
);
return
NULL
;
}
}
if
(
oid
==
Py_None
||
jar
!=
self
->
jar
)
{
...
...
@@ -319,7 +328,7 @@ void
initcoptimizations
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.
7
$"
;
char
*
rev
=
"$Revision: 1.
8
$"
;
#define make_string(S) if (! (py_ ## S=PyString_FromString(#S))) return
make_string
(
_p_oid
);
...
...
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