Skip to content
This repository has been 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

Permalink
fix bugs (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and BetaCat0 committed Jul 30, 2019
1 parent 2ad174c commit 9681be3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions session_find.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte
}

func (session *Session) find(rowsSlicePtr interface{}, condiBean ...interface{}) error {
defer session.resetStatement()

if session.statement.lastError != nil {
return session.statement.lastError
}
Expand Down
4 changes: 4 additions & 0 deletions session_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func (session *Session) Get(bean interface{}) (bool, error) {
}

func (session *Session) get(bean interface{}) (bool, error) {
defer session.resetStatement()

if session.statement.lastError != nil {
return false, session.statement.lastError
}
Expand Down Expand Up @@ -75,6 +77,8 @@ func (session *Session) get(bean interface{}) (bool, error) {
if context != nil {
res := context.Get(fmt.Sprintf("%v-%v", sqlStr, args))
if res != nil {
session.engine.logger.Debug("hit context cache", sqlStr)

structValue := reflect.Indirect(reflect.ValueOf(bean))
structValue.Set(reflect.Indirect(reflect.ValueOf(res)))
session.lastSQL = ""
Expand Down

0 comments on commit 9681be3

Please sign in to comment.