fixed cache usage error when using session.Find()
This commit is contained in:
parent
5fa8a7271d
commit
e7379dc7d9
|
@ -1037,11 +1037,13 @@ func (session *Session) Find(rowsSlicePtr interface{}, condiBean ...interface{})
|
||||||
if err != ErrCacheFailed {
|
if err != ErrCacheFailed {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
err = nil // !nashtsai! reset err to nil for ErrCacheFailed
|
||||||
session.Engine.LogWarn("Cache Find Failed")
|
session.Engine.LogWarn("Cache Find Failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
if sliceValue.Kind() != reflect.Map {
|
if sliceValue.Kind() != reflect.Map {
|
||||||
var rawRows *sql.Rows
|
var rawRows *sql.Rows
|
||||||
|
var stmt *sql.Stmt
|
||||||
|
|
||||||
session.queryPreprocess(&sqlStr, args...)
|
session.queryPreprocess(&sqlStr, args...)
|
||||||
// err = session.queryRows(&stmt, &rawRows, sqlStr, args...)
|
// err = session.queryRows(&stmt, &rawRows, sqlStr, args...)
|
||||||
|
@ -1054,7 +1056,7 @@ func (session *Session) Find(rowsSlicePtr interface{}, condiBean ...interface{})
|
||||||
// defer rawRows.Close()
|
// defer rawRows.Close()
|
||||||
|
|
||||||
if session.IsAutoCommit {
|
if session.IsAutoCommit {
|
||||||
stmt, err := session.Db.Prepare(sqlStr)
|
stmt, err = session.Db.Prepare(sqlStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue