Commit 94e71512 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1cdfff35
......@@ -23,7 +23,7 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb/internal/weak"
)
// Connection represents a view of ZODB database.
// Connection represents a view of ZODB database. XXX + live application objects.
//
// The view is representing state of ZODB objects as of `at` transaction.
//
......@@ -245,12 +245,12 @@ func (conn *Connection) Get(ctx context.Context, oid Oid) (IPersistent, error) {
// object is not there in objtab - raw load it, get its class -> get(pyclass, oid)
// XXX py hardcoded
pyclass, pystate, serial, err := conn.loadpy(ctx, oid)
class, pystate, serial, err := conn.loadpy(ctx, oid)
if err != nil {
return nil, err // XXX errctx
}
obj, err := conn.get(pyclass.Module + "." + pyclass.Name, oid)
obj, err := conn.get(class, oid)
if err != nil {
return nil, err
}
......
......@@ -148,18 +148,19 @@ func (d *dummyPyInstance) PySetState(pystate interface{}) error {
//
// loadpy does not create any in-RAM object associated with Connection.
// It only returns decoded database data.
func (conn *Connection) loadpy(ctx context.Context, oid Oid) (pyclass pickle.Class, pystate interface{}, serial Tid, _ error) {
func (conn *Connection) loadpy(ctx context.Context, oid Oid) (class string, pystate interface{}, serial Tid, _ error) {
buf, serial, err := conn.stor.Load(ctx, Xid{Oid: oid, At: conn.at})
if err != nil {
return pickle.Class{}, nil, 0, err
return "", nil, 0, err
}
defer buf.Release()
pyclass, pystate, err = PyData(buf.Data).Decode()
if err != nil {
return pickle.Class{}, nil, 0, err // XXX err ctx
return "", nil, 0, err // XXX err ctx
}
return pyclass, pystate, serial, nil
class := pyclass.Module + "." + pyclass.Name // full pyclass path
return class, pystate, serial, nil
}
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