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) { ...@@ -155,6 +155,10 @@ func (conn *Connection) get(class string, oid Oid) (IPersistent, error) {
} }
if obj == nil { if obj == nil {
obj = newGhost(class, oid, conn) 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) conn.objtab[oid] = weak.NewRef(obj)
} else { } else {
checkClass = true checkClass = true
......
...@@ -383,6 +383,7 @@ func newGhost(class string, oid Oid, jar *Connection) IPersistent { ...@@ -383,6 +383,7 @@ func newGhost(class string, oid Oid, jar *Connection) IPersistent {
var xpobj reflect.Value // *typ var xpobj reflect.Value // *typ
zc := classTab[class] zc := classTab[class]
if zc == nil { if zc == nil {
//return nil
zc = brokenZClass zc = brokenZClass
xpobj = reflect.ValueOf(&Broken{class: class}) xpobj = reflect.ValueOf(&Broken{class: class})
} else { } else {
...@@ -439,6 +440,11 @@ func (b *brokenState) SetState(state *mem.Buf) error { ...@@ -439,6 +440,11 @@ func (b *brokenState) SetState(state *mem.Buf) error {
return nil 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. // brokenZClass is used for Persistent.zclass for Broken objects.
var brokenZClass = &zclass{ var brokenZClass = &zclass{
class: "", 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