Commit e38e26e2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9a51360f
......@@ -155,6 +155,10 @@ func (conn *Connection) get(class string, oid Oid) (IPersistent, error) {
}
if obj == nil {
obj = newGhost(class, oid, conn)
//if obj == nil {
// conn.objmu.Unlock()
// return nil, fmt.Errorf("get %s: class %q not supported", Xid{conn.at, oid}, class)
//}
conn.objtab[oid] = weak.NewRef(obj)
} else {
checkClass = true
......
......@@ -383,6 +383,7 @@ func newGhost(class string, oid Oid, jar *Connection) IPersistent {
var xpobj reflect.Value // *typ
zc := classTab[class]
if zc == nil {
//return nil
zc = brokenZClass
xpobj = reflect.ValueOf(&Broken{class: class})
} else {
......@@ -439,6 +440,11 @@ func (b *brokenState) SetState(state *mem.Buf) error {
return nil
}
// XXX how to print zodb.Broken("BTrees.IOBTree.IOBTree"), but not long noise for types that don't define GoString?
func (b *Broken) GoString() string {
return fmt.Sprintf("&zodb.Broken(%q)", b.class)
}
// brokenZClass is used for Persistent.zclass for Broken objects.
var brokenZClass = &zclass{
class: "",
......
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