Commit 8d4a5f14 authored by Jim Fulton's avatar Jim Fulton

Added logic to keep a reference to the root object to keep it from being

dropped from the cache.
parent c9f496ac
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.7 1999/05/24 21:46:21 jim Exp $""" $Id: Connection.py,v 1.8 1999/06/11 18:24:02 jim Exp $"""
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.8 $'[11:-2]
from cPickleCache import PickleCache from cPickleCache import PickleCache
from POSException import ConflictError, ExportError from POSException import ConflictError, ExportError
...@@ -160,6 +160,7 @@ class Connection(ExportImport.ExportImport): ...@@ -160,6 +160,7 @@ class Connection(ExportImport.ExportImport):
object._p_serial=serial object._p_serial=serial
cache[oid]=object cache[oid]=object
if oid=='\0\0\0\0\0\0\0\0': self._root_=object # keep a ref
return object return object
def _persistent_load(self,oid, def _persistent_load(self,oid,
...@@ -290,7 +291,7 @@ class Connection(ExportImport.ExportImport): ...@@ -290,7 +291,7 @@ class Connection(ExportImport.ExportImport):
klass = object.__class__ klass = object.__class__
if klass is ExtensionKlass: if klass is ExtensionKlass:
# Ye Ha! # Yee Ha!
dict={} dict={}
dict.update(object.__dict__) dict.update(object.__dict__)
del dict['_p_jar'] del dict['_p_jar']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment