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.

fix bugs #1375

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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