batch.go
func (wb *WriteBatch) commit() error {
	if wb.err != nil {
		return wb.err
	}
	// Get a new txn before we commit this one. So, the new txn doesn't need
	// to wait for this one to commit.
	wb.wg.Add(1)
	wb.txn.CommitWith(wb.callback)
	wb.txn = wb.db.newTransaction(true, true)
	// See comment about readTs in NewWriteBatch.
	wb.txn.readTs = wb.db.orc.readMark.DoneUntil()
	return wb.err
}
func (wb *WriteBatch) commit() error {
	if wb.err != nil {
		return wb.err
	}
	// Get a new txn before we commit this one. So, the new txn doesn't need
	// to wait for this one to commit.
	wb.wg.Add(1)
	wb.txn.CommitWith(wb.callback)
	wb.txn = wb.db.newTransaction(true, true)
	// See comment about readTs in NewWriteBatch.
	wb.txn.readTs = wb.db.orc.readMark.DoneUntil()
	return wb.err
}
func ( wb * WriteBatch ) commit ( ) error { if wb . err != nil { return wb . err } // Get a new txn before we commit this one. So, the new txn doesn't need // to wait for this one to commit. wb . wg . Add ( 1 ) wb . txn . CommitWith ( wb . callback ) wb . txn = wb . db . newTransaction ( true , true ) // See comment about readTs in NewWriteBatch. wb . txn . readTs = wb . db . orc . readMark . DoneUntil ( ) return wb . err }
// Caller to commit must hold a write lock.
Caller to commit must hold a write lock .