Commit 75a0c643 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bed9a661
...@@ -39,6 +39,8 @@ import ( ...@@ -39,6 +39,8 @@ import (
// //
// Connection and objects obtained from it must be used by application only // Connection and objects obtained from it must be used by application only
// inside transaction where Connection was opened. // inside transaction where Connection was opened.
//
// Use DB.Open to open a connection.
type Connection struct { type Connection struct {
stor IStorage // underlying storage stor IStorage // underlying storage
db *DB // Connection is part of this DB db *DB // Connection is part of this DB
......
...@@ -61,10 +61,12 @@ func NewDB(stor IStorage) *DB { ...@@ -61,10 +61,12 @@ func NewDB(stor IStorage) *DB {
return &DB{stor: stor} return &DB{stor: stor}
} }
// Open opens new connection to the database. XXX @lastTid // Open opens new connection to the database.
// //
// XXX must be called under transaction. // The connection is opened to current latest database state.
// XXX connectin must be used under the same transaction only. //
// Open must be called under transaction.
// Opened connection must be used under the same transaction only.
// //
// XXX text // XXX text
// //
...@@ -190,5 +192,7 @@ func (csync *connTxnSync) AfterCompletion(txn transaction.Transaction) { ...@@ -190,5 +192,7 @@ func (csync *connTxnSync) AfterCompletion(txn transaction.Transaction) {
conn := (*Connection)(csync) conn := (*Connection)(csync)
conn.checkTxn(txn, "AfterCompletion") conn.checkTxn(txn, "AfterCompletion")
// XXX check that conn was explicitly closed by user?
conn.db.put(conn) conn.db.put(conn)
} }
...@@ -337,7 +337,10 @@ type IStorageDriver interface { ...@@ -337,7 +337,10 @@ type IStorageDriver interface {
// To simplify drivets, there must be only 1 logical user of // To simplify drivets, there must be only 1 logical user of
// storage-driver level notifier interface. Ccontrary IStorage allows // storage-driver level notifier interface. Ccontrary IStorage allows
// for several users of notification channel. XXX ok? // for several users of notification channel. XXX ok?
Notifier() Notifier //
// XXX -> nil, if driver does not support notifications?
// XXX or always support them, even with FileStorage (inotify)?
//Notifier() Notifier
} }
// Loader provides functionality to load objects. // Loader provides functionality to load objects.
......
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