forked from mirror/ledisdb
add warn log for transaction
This commit is contained in:
parent
2d113aa9be
commit
ef8d5f7b69
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue