Commit 64356821 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fb9d0fce
......@@ -26,11 +26,40 @@ import (
// Object is the interface that every in-RAM object representing any ZODB object implements.
type Object interface {
// XXX make methods private, e.g. _pJar ?
PJar() *Connection
POid() zodb.Oid
PSerial() zodb.Tid
// XXX activate/deactivate/invalidate here?
// PActivate requests in-RAM object data to be present.
//
// On successful return the object data is either the same as in the
// database or, if this data was previously modified by user of
// object's jar, that modified data.
//
// Object data must be accessed only after corresponding PActivate
// call, which marks that object's data as being in use.
PActivate(ctx context.Context) error // XXX + -> nuse ?
// PDeactivate indicates that corresponding PActivate caller finished access to object's data.
//
// As PActivate makes sure object's data is present in-RAM, PDeactivate
// tells persistency layer that this data is no longer used by
// corresponding PActivate caller.
//
// Note that it is valid to have several concurrent uses of object
// data, each protected with corresponding PActivate/PDeactivate pair:
// As long as there is still any PActivate not yet compensated with
// corresponding PDeactivate, object data will stay alive in RAM.
//
// Besides exotic cases, the caller thus must not use object's data
// after PDeactivate call.
PDeactivate() // XXX + -> nuse ?
PInvalidate() // XXX must not be called while there are users.
}
// PyObject is the interface that every in-RAM object representing Python ZODB object implements.
......@@ -448,8 +477,9 @@ func (pyobj *pyObject) PActivate(ctx context.Context) error {
}
if pyclass != pyobj.pyclass {
// XXX complain pyclass changed
// XXX both ref and object data uses pyclass so it indeed can be different
// complain pyclass changed
// (both ref and object data uses pyclass so it indeed can be different)
return &wrongClassError{want: pyobj.pyclass, have: pyclass} // XXX + err ctx
}
pyobj.serial = serial
......
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