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
Joshua
zodb
Commits
7f49a29f
Commit
7f49a29f
authored
Mar 04, 2004
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed the _classFactory attribute to classFactory.
parent
37d0cf64
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
28 deletions
+13
-28
src/ZODB/Connection.py
src/ZODB/Connection.py
+3
-3
src/ZODB/DB.py
src/ZODB/DB.py
+5
-20
src/ZODB/Mount.py
src/ZODB/Mount.py
+4
-4
src/ZODB/tests/testConnection.py
src/ZODB/tests/testConnection.py
+1
-1
No files found.
src/ZODB/Connection.py
View file @
7f49a29f
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Database connection support
"""Database connection support
$Id: Connection.py,v 1.13
5 2004/03/04 19:48:03 jeremy
Exp $"""
$Id: Connection.py,v 1.13
6 2004/03/04 22:41:50 jim
Exp $"""
import
logging
import
logging
import
sys
import
sys
...
@@ -125,7 +125,7 @@ class Connection(ExportImport, object):
...
@@ -125,7 +125,7 @@ class Connection(ExportImport, object):
their state and register changes. The methods are setstate(),
their state and register changes. The methods are setstate(),
register(), setklassstate().
register(), setklassstate().
$Id: Connection.py,v 1.13
5 2004/03/04 19:48:03 jeremy
Exp $
$Id: Connection.py,v 1.13
6 2004/03/04 22:41:50 jim
Exp $
"""
"""
_tmp
=
None
_tmp
=
None
...
@@ -348,7 +348,7 @@ class Connection(ExportImport, object):
...
@@ -348,7 +348,7 @@ class Connection(ExportImport, object):
else
:
else
:
self
.
_flush_invalidations
()
self
.
_flush_invalidations
()
self
.
_reader
=
ConnectionObjectReader
(
self
,
self
.
_cache
,
self
.
_reader
=
ConnectionObjectReader
(
self
,
self
.
_cache
,
self
.
_db
.
_
classFactory
)
self
.
_db
.
classFactory
)
self
.
_opened
=
time
()
self
.
_opened
=
time
()
def
_resetCache
(
self
):
def
_resetCache
(
self
):
...
...
src/ZODB/DB.py
View file @
7f49a29f
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Database objects
"""Database objects
$Id: DB.py,v 1.
69 2004/03/04 19:48:04 jeremy
Exp $"""
$Id: DB.py,v 1.
70 2004/03/04 22:41:50 jim
Exp $"""
import
cPickle
,
cStringIO
,
sys
import
cPickle
,
cStringIO
,
sys
from
thread
import
allocate_lock
from
thread
import
allocate_lock
...
@@ -45,9 +45,8 @@ class DB(object):
...
@@ -45,9 +45,8 @@ class DB(object):
it to provide a different connection implementation.
it to provide a different connection implementation.
The database provides a few methods intended for application code
The database provides a few methods intended for application code
-- open, close, undo, pack, setClassFactory -- and a large
-- open, close, undo, and pack -- and a large collection of
collection of methods for inspecting the database and its connections'
methods for inspecting the database and its connections' caches.
caches.
"""
"""
klass
=
Connection
# Class to use for connections
klass
=
Connection
# Class to use for connections
...
@@ -142,9 +141,6 @@ class DB(object):
...
@@ -142,9 +141,6 @@ class DB(object):
else
:
m
=
None
else
:
m
=
None
return
m
return
m
def
_classFactory
(
self
,
connection
,
modulename
,
globalname
):
return
find_global
(
modulename
,
globalname
)
def
_closeConnection
(
self
,
connection
):
def
_closeConnection
(
self
,
connection
):
"""Return a connection to the pool"""
"""Return a connection to the pool"""
self
.
_a
()
self
.
_a
()
...
@@ -574,19 +570,8 @@ class DB(object):
...
@@ -574,19 +570,8 @@ class DB(object):
for
c
in
pool_info
[
1
]:
for
c
in
pool_info
[
1
]:
c
.
_cache
.
cache_size
=
v
c
.
_cache
.
cache_size
=
v
def
setClassFactory
(
self
,
factory
):
def
classFactory
(
self
,
connection
,
modulename
,
globalname
):
"""Override default mechanism for loading object classes.
return
find_global
(
modulename
,
globalname
)
The database stores objects, but uses Python's standard import
to load the code for those objects. The class factory is used
by the database serialization layer to find the classes. It
uses ZODB.broken.find_global by default.
This method can be used to override the default class loading
code. See ZODB.broken.find_global for details
about the contract of factory.
"""
self
.
_classFactory
=
factory
def
setPoolSize
(
self
,
v
):
def
setPoolSize
(
self
,
v
):
self
.
_pool_size
=
v
self
.
_pool_size
=
v
...
...
src/ZODB/Mount.py
View file @
7f49a29f
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
##############################################################################
##############################################################################
"""Mounted database support
"""Mounted database support
$Id: Mount.py,v 1.2
2 2004/02/27 00:31:53 faassen
Exp $"""
$Id: Mount.py,v 1.2
3 2004/03/04 22:41:50 jim
Exp $"""
__version__
=
'$Revision: 1.2
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
import
thread
,
persistent
,
Acquisition
import
thread
,
persistent
,
Acquisition
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
...
@@ -41,7 +41,7 @@ def parentClassFactory(jar, module, name):
...
@@ -41,7 +41,7 @@ def parentClassFactory(jar, module, name):
return
getattr
(
__import__
(
return
getattr
(
__import__
(
module
,
_globals
,
_globals
,
_silly
),
name
)
module
,
_globals
,
_globals
,
_silly
),
name
)
else
:
else
:
return
parent_db
.
_
classFactory
(
parent_conn
,
module
,
name
)
return
parent_db
.
classFactory
(
parent_conn
,
module
,
name
)
class
MountPoint
(
persistent
.
Persistent
,
Acquisition
.
Implicit
):
class
MountPoint
(
persistent
.
Persistent
,
Acquisition
.
Implicit
):
...
@@ -105,7 +105,7 @@ class MountPoint(persistent.Persistent, Acquisition.Implicit):
...
@@ -105,7 +105,7 @@ class MountPoint(persistent.Persistent, Acquisition.Implicit):
dbs
[
params
]
=
(
db
,
{
self
.
__mountpoint_id
:
1
})
dbs
[
params
]
=
(
db
,
{
self
.
__mountpoint_id
:
1
})
if
getattr
(
self
,
'_classDefsFromRoot'
,
1
):
if
getattr
(
self
,
'_classDefsFromRoot'
,
1
):
db
.
setClassFactory
(
parentClassFactory
)
db
.
classFactory
=
parentClassFactory
else
:
else
:
db
,
mounts
=
dbInfo
db
,
mounts
=
dbInfo
# Be sure this object is in the list of mount points.
# Be sure this object is in the list of mount points.
...
...
src/ZODB/tests/testConnection.py
View file @
7f49a29f
...
@@ -569,7 +569,7 @@ class StubDatabase:
...
@@ -569,7 +569,7 @@ class StubDatabase:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_storage
=
StubStorage
()
self
.
_storage
=
StubStorage
()
_
classFactory
=
None
classFactory
=
None
def
invalidate
(
self
,
transaction
,
dict_with_oid_keys
,
connection
):
def
invalidate
(
self
,
transaction
,
dict_with_oid_keys
,
connection
):
pass
pass
...
...
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