Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
64356821
Commit
64356821
authored
Jul 16, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fb9d0fce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
wcfs/zodb.go
wcfs/zodb.go
+33
-3
No files found.
wcfs/zodb.go
View file @
64356821
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment