diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dedo.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dedo.go b/src/dedo.go index dedeaa9..734b384 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -2010,7 +2010,7 @@ func (db *DB) close() error { /// IMPORTANT: You must close read-only transactions after you are finished or /// else the database will not reclaim old pages. -func (db *DB) beginTx() (*transactionT, error) { +func (db *DB) beginSnapshot() (*transactionT, error) { // Lock the meta pages while we initialize the transaction. We obtain // the meta lock before the mmap lock because that's the order that the // write transaction will obtain them. @@ -2041,7 +2041,7 @@ func (db *DB) beginTx() (*transactionT, error) { return t, nil } -func (db *DB) beginRWTx() (*transactionT, error) { +func (db *DB) beginTransaction() (*transactionT, error) { // Obtain writer lock. This is released by the transaction when it // closes. This enforces only one writer transaction at a time. db.rwlock.Lock() @@ -2108,7 +2108,7 @@ func (db *DB) removeTx(tx *transactionT) { /// Attempting to manually commit or rollback within the function will cause a /// panic. func (db *DB) Update(fn func(TransactionI) error) error { - t, err := db.beginRWTx() + t, err := db.beginTransaction() if err != nil { return err } @@ -2137,7 +2137,7 @@ func (db *DB) Update(fn func(TransactionI) error) error { /// /// Attempting to manually rollback within the function will cause a panic. func (db *DB) View(fn func(SnapshotI) error) error { - t, err := db.beginTx() + t, err := db.beginSnapshot() if err != nil { return err } |