Commit 2db89587 authored by Aurel's avatar Aurel

encode oid, tid, serial for load


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@97 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent cd8efbfe
from Queue import Queue from Queue import Queue
from threading import Lock from threading import Lock
from ZODB import BaseStorage, ConflictResolution, POSException from ZODB import BaseStorage, ConflictResolution, POSException
from ZODB.utils import oid_repr, p64, u64
from neo.client.dispatcher import Dispatcher from neo.client.dispatcher import Dispatcher
from neo.event import EventManager from neo.event import EventManager
...@@ -44,7 +45,7 @@ class NEOStorage(BaseStorage.BaseStorage, ...@@ -44,7 +45,7 @@ class NEOStorage(BaseStorage.BaseStorage,
def load(self, oid, version=None): def load(self, oid, version=None):
try: try:
return self.app.process_method('load', oid=oid) return self.app.process_method('load', oid=u64(oid))
except NEOStorageNotFoundError: except NEOStorageNotFoundError:
raise POSException.POSKeyError (oid) raise POSException.POSKeyError (oid)
...@@ -123,13 +124,13 @@ class NEOStorage(BaseStorage.BaseStorage, ...@@ -123,13 +124,13 @@ class NEOStorage(BaseStorage.BaseStorage,
# mutliple revisions # mutliple revisions
def loadSerial(self, oid, serial): def loadSerial(self, oid, serial):
try: try:
return self.app.process_method('loadSerial', oid=oid, serial=serial) return self.app.process_method('loadSerial', oid=u64(oid), serial=u64(serial))
except NEOStorageNotFoundError: except NEOStorageNotFoundError:
raise POSException.POSKeyError (oid, serial) raise POSException.POSKeyError (oid, serial)
def loadBefore(self, oid, tid): def loadBefore(self, oid, tid):
try: try:
return self.app.process_method('loadBefore', oid=oid, tid=tid) return self.app.process_method('loadBefore', oid=u64(oid), tid=u64(tid))
except NEOStorageNotFoundError: except NEOStorageNotFoundError:
raise POSException.POSKeyError (oid, tid) raise POSException.POSKeyError (oid, tid)
......
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