Commit 6463acfc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 65a8bc82
...@@ -23,6 +23,9 @@ package zodb ...@@ -23,6 +23,9 @@ package zodb
// Connection is safe to access from multiple goroutines simultaneously. // Connection is safe to access from multiple goroutines simultaneously.
// //
// XXX ^^^ modifications? // XXX ^^^ modifications?
//
// Connection and objects obtained from it must be used by application only
// inside transaction where Connection was opened.
type Connection struct { type Connection struct {
stor IStorage // underlying storage stor IStorage // underlying storage
at Tid // current view of database at Tid // current view of database
...@@ -95,3 +98,12 @@ type LiveCacheControl interface { ...@@ -95,3 +98,12 @@ type LiveCacheControl interface {
} }
// XXX Connection.{Get,get} without py dependency?
// but then how to create a ghost of correct class? -> reflect.Type?
// load loads object specified by oid.
//
// XXX must be called ... (XXX e.g. outside transaction boundary) so that there is no race on .at .
func (conn *Connection) load(ctx context.Context, oid Oid) (_ *mem.Buf, serial Tid, _ error) {
return conn.stor.Load(ctx, Xid{Oid: oid, At: conn.at})
}
...@@ -267,16 +267,3 @@ func (obj *Persistent) PInvalidate() { ...@@ -267,16 +267,3 @@ func (obj *Persistent) PInvalidate() {
obj.state = GHOST obj.state = GHOST
obj.loading = nil obj.loading = nil
} }
// ----------------------------------------
// XXX Connection.{Get,get} without py dependency?
// but then how to create a ghost of correct class? -> reflect.Type?
// load loads object specified by oid.
//
// XXX must be called ... (XXX e.g. outside transaction boundary) so that there is no race on .at .
func (conn *Connection) load(ctx context.Context, oid Oid) (_ *mem.Buf, serial Tid, _ error) {
return conn.stor.Load(ctx, Xid{Oid: oid, At: conn.at})
}
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