From a1f43f4d60bf434baebf13b4810e5db4916baec5 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 1 Mar 2014 09:13:59 -0700 Subject: Allow reads of unflushed nodes. This commit allows cursors to read updated values from within the RWTransaction. --- rwtransaction.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rwtransaction.go') diff --git a/rwtransaction.go b/rwtransaction.go index ddd4b96..f47597f 100644 --- a/rwtransaction.go +++ b/rwtransaction.go @@ -11,7 +11,6 @@ import ( // functions provided by Transaction. type RWTransaction struct { Transaction - nodes map[pgid]*node pending []*node } @@ -20,6 +19,7 @@ func (t *RWTransaction) init(db *DB) { t.Transaction.init(db) t.Transaction.rwtransaction = t t.pages = make(map[pgid]*page) + t.nodes = make(map[pgid]*node) // Increment the transaction id. t.meta.txnid += txnid(1) @@ -266,7 +266,7 @@ func (t *RWTransaction) writeMeta() error { // node creates a node from a page and associates it with a given parent. func (t *RWTransaction) node(pgid pgid, parent *node) *node { // Retrieve node if it has already been fetched. - if n := t.nodes[pgid]; n != nil { + if n := t.Transaction.node(pgid); n != nil { return n } -- cgit v1.2.3