Commit a8c86cd0 authored by Aurel's avatar Aurel

add registerDB method and invalidate oid also in DB object


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@150 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ecb3ce11
......@@ -198,3 +198,6 @@ class NEOStorage(BaseStorage.BaseStorage,
def __len__(self):
# XXX bogus but how to implement this?
return 0
def registerDB(self, db, limit):
self.app.registerDB(db, limit)
......@@ -194,6 +194,9 @@ class Application(ThreadingMixIn, object):
message[0].handler.dispatch(message[0], message[1])
def registerDB(self, db, limit):
self._db = db
def new_oid(self):
"""Get a new OID."""
self._oid_lock_acquire()
......
......@@ -364,9 +364,14 @@ class ClientEventHandler(EventHandler):
app = self.app
app._cache_lock_acquire()
try:
# ZODB required a dict with oid as key, so create it
oids = {}
for oid in oid_list:
oids[oid] = 1
if app.mq_cache.has_key(oid):
del app.mq_cache[oid]
if app._db is not None:
app._db.invalidate(None, oids)
finally:
app._cache_lock_release()
else:
......
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