Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 9681be3

Browse files
lunnyBetaCat0
authored andcommitted
fix bugs (#1375)
1 parent 2ad174c commit 9681be3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

session_find.go

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte
6363
}
6464

6565
func (session *Session) find(rowsSlicePtr interface{}, condiBean ...interface{}) error {
66+
defer session.resetStatement()
67+
6668
if session.statement.lastError != nil {
6769
return session.statement.lastError
6870
}

session_get.go

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func (session *Session) Get(bean interface{}) (bool, error) {
2424
}
2525

2626
func (session *Session) get(bean interface{}) (bool, error) {
27+
defer session.resetStatement()
28+
2729
if session.statement.lastError != nil {
2830
return false, session.statement.lastError
2931
}
@@ -75,6 +77,8 @@ func (session *Session) get(bean interface{}) (bool, error) {
7577
if context != nil {
7678
res := context.Get(fmt.Sprintf("%v-%v", sqlStr, args))
7779
if res != nil {
80+
session.engine.logger.Debug("hit context cache", sqlStr)
81+
7882
structValue := reflect.Indirect(reflect.ValueOf(bean))
7983
structValue.Set(reflect.Indirect(reflect.ValueOf(res)))
8084
session.lastSQL = ""

0 commit comments

Comments
 (0)