Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
ff2892a5
Commit
ff2892a5
authored
Jul 26, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
366483d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
go/zodb/zodb.go
go/zodb/zodb.go
+32
-11
No files found.
go/zodb/zodb.go
View file @
ff2892a5
...
...
@@ -17,11 +17,10 @@
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// Package zodb defines types, interfaces and errors to work with ZODB databases.
// XXX ... provides access to ZODB databases?
// Package zodb provides API to work with ZODB databases.
//
// ZODB (http://zodb.org) was originally created in Python world by Jim Fulton et al.
// Data model
this package provides is
partly based on ZODB/py
// Data model
and API this package provides are
partly based on ZODB/py
// (https://github.com/zopefoundation/ZODB) to maintain compatibility in
// between Python and Go implementations.
//
...
...
@@ -48,26 +47,30 @@
// Object state data is generally opaque, but is traditionally based on Python
// pickles in ZODB/py world.
//
// An object can reference other objects in the database by their oid.
//
//
// Storage layer
//
// The storage layer provides access to a ZODB database in terms of database
// records with raw bytes
for
payload.
// records with raw bytes payload.
//
// At storage level a ZODB database can be opened with OpenStorage. Once opened
// IStorage interface is returned that represents access to the database.
// Please see documentation of IStorage, and other interfaces it embeds, for
// details.
// Please see IStorage, and interfaces it embeds, for details.
//
//
// Application layer
//
// The application layer provides access to a ZODB database in terms of in-RAM
// objects whose in-RAM state is synchronized with data in the database. For
//
application-level
objects whose in-RAM state is synchronized with data in the database. For
// the synchronization to work, objects must be explicitly activated before
// access (contrary to zodb/py where activation is implicit hooked into
// access (contrary to zodb/py where activation is implicit
,
hooked into
// __getattr__), for example:
//
// var obj *MyObject // *MyObject must implement IPersistent (see below)
// ... // init obj pointer, usually by traversing from another persistent object.
//
// // make sure object's in-RAM data is present.
// //
// // ZODB will load corresponding data and decode it into obj.
...
...
@@ -77,15 +80,33 @@
// return ... // handle error
// }
//
// ... // use object.
// obj.xxx // use object.
// if ... {
// obj.xxx++ // change object.
// obj.PModify() // let persistency layer know we modified the object.
// }
//
// // tell persistency layer we no longer need obj's in-RAM data to be present.
// // if obj was not modified, its in-RAM state might go away after.
// obj.PDeactivate()
//
// See IPersistent interface for details of the activation protocol.
// IPersistent interface describes the details of the activation protocol.
//
// In-RAM application objects are handled in groups. During the scope of
// corresponding in-progress transaction, a group corresponds to particular
// view of the database (at) and has isolation guarantee from further database
// transactions, and from in-progress changes to in-RAM objects in other
// groups.
//
// If object₁ references object₂ in the database, the database reference will
// be represented with corresponding reference between in-RAM application
// objects. If there are multiple database references to one object, it will be
// represented by several references to single in-RAM application object.
// Reference cycles are also allowed. In general objects graph in the database
// is isomorphly mapped to application objects graph in RAM.
//
//
// XXX
DB + Connection
.
// XXX
Connection + DB
.
//
// XXX access from several threads is ok.
//
...
...
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