Commit a2ccfe68 authored by Jim Fulton's avatar Jim Fulton

Added extra meta-data for debugging purposes.

parent c0fc1c51
...@@ -84,14 +84,15 @@ ...@@ -84,14 +84,15 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.22 1999/08/13 21:49:07 klm Exp $""" $Id: Connection.py,v 1.23 1999/08/25 17:35:45 jim Exp $"""
__version__='$Revision: 1.22 $'[11:-2] __version__='$Revision: 1.23 $'[11:-2]
from cPickleCache import PickleCache from cPickleCache import PickleCache
from POSException import ConflictError, ExportError from POSException import ConflictError, ExportError
from cStringIO import StringIO from cStringIO import StringIO
from cPickle import Unpickler, Pickler from cPickle import Unpickler, Pickler
from ExtensionClass import Base from ExtensionClass import Base
from time import time
import Transaction, string, ExportImport, sys, traceback, TmpStore import Transaction, string, ExportImport, sys, traceback, TmpStore
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
...@@ -110,6 +111,8 @@ class Connection(ExportImport.ExportImport): ...@@ -110,6 +111,8 @@ class Connection(ExportImport.ExportImport):
The Connection manages movement of objects in and out of object storage. The Connection manages movement of objects in and out of object storage.
""" """
_tmp=None _tmp=None
_debug_info=()
_opened=None
def __init__(self, version='', cache_size=400, def __init__(self, version='', cache_size=400,
cache_deactivate_after=60): cache_deactivate_after=60):
...@@ -220,6 +223,7 @@ class Connection(ExportImport.ExportImport): ...@@ -220,6 +223,7 @@ class Connection(ExportImport.ExportImport):
self._storage=s=odb._storage self._storage=s=odb._storage
self.new_oid=s.new_oid self.new_oid=s.new_oid
self._cache.invalidate(self._invalidated) self._cache.invalidate(self._invalidated)
self._opened=time()
return self return self
...@@ -233,7 +237,8 @@ class Connection(ExportImport.ExportImport): ...@@ -233,7 +237,8 @@ class Connection(ExportImport.ExportImport):
def close(self): def close(self):
self._incrgc() self._incrgc()
db=self._db db=self._db
self._db=self._storage=self._tmp=self.new_oid=None self._db=self._storage=self._tmp=self.new_oid=self._opened=None
self._debug_info=()
db._closeConnection(self) db._closeConnection(self)
def commit(self, object, transaction): def commit(self, object, transaction):
...@@ -470,6 +475,9 @@ class Connection(ExportImport.ExportImport): ...@@ -470,6 +475,9 @@ class Connection(ExportImport.ExportImport):
get_transaction().abort() get_transaction().abort()
self._cache.invalidate(self._invalidated) self._cache.invalidate(self._invalidated)
def getDebugInfo(self): return self._debug_info
def setDebugInfo(self, *args): self._debug_info=self._debug_info+args
###################################################################### ######################################################################
# Just plain weird. Don't try this at home kids. # Just plain weird. Don't try this at home kids.
......
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