add warn log for transaction

This commit is contained in:
siddontang 2015-03-12 11:38:21 +08:00
parent 2d113aa9be
commit ef8d5f7b69
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package ledis
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/siddontang/go/log"
"github.com/siddontang/ledisdb/store" "github.com/siddontang/ledisdb/store"
) )
@ -26,6 +27,8 @@ func (db *DB) IsTransaction() bool {
// Begin a transaction, it will block all other write operations before calling Commit or Rollback. // Begin a transaction, it will block all other write operations before calling Commit or Rollback.
// You must be very careful to prevent long-time transaction. // You must be very careful to prevent long-time transaction.
func (db *DB) Begin() (*Tx, error) { func (db *DB) Begin() (*Tx, error) {
log.Warn("Transaction support will be removed later, use your own risk!!!")
if db.IsTransaction() { if db.IsTransaction() {
return nil, ErrNestTx return nil, ErrNestTx
} }