aboutsummaryrefslogtreecommitdiff
path: root/rwtransaction.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-03-01 09:13:59 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-03-01 09:13:59 -0700
commita1f43f4d60bf434baebf13b4810e5db4916baec5 (patch)
tree75850081fdb236f37c82d6e8fcd4cde5b81354d8 /rwtransaction.go
parentMerge branch 'master' of https://github.com/boltdb/bolt (diff)
downloaddedo-a1f43f4d60bf434baebf13b4810e5db4916baec5.tar.gz
dedo-a1f43f4d60bf434baebf13b4810e5db4916baec5.tar.xz
Allow reads of unflushed nodes.
This commit allows cursors to read updated values from within the RWTransaction.
Diffstat (limited to 'rwtransaction.go')
-rw-r--r--rwtransaction.go4
1 files changed, 2 insertions, 2 deletions
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
}