tx commit bugfix

This commit is contained in:
siddontang 2014-08-25 16:19:28 +08:00
parent 9b1c6c4223
commit 76896882a9
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,8 @@ type Tx struct {
tx *store.Tx
logs [][]byte
index uint8
}
func (db *DB) IsTransaction() bool {
@ -132,6 +134,7 @@ func (db *DB) Begin() (*Tx, error) {
tx.DB.dbLock.Lock()
tx.DB.l = db.l
tx.index = db.index
tx.DB.sdb = db.sdb
@ -201,3 +204,7 @@ func (tx *Tx) newBatch() *batch {
return b
}
func (tx *Tx) Index() int {
return int(tx.index)
}