Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Apr 13, 2019
1 parent b82cf74 commit 414196a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions GoMybatis.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,9 @@ func WriteMapper(bean reflect.Value, xml []byte, sessionFactory *SessionFactory,
}
returnValue = &returnV
}
var session Session
var session = sessionFactory.NewSession(beanName, SessionType_Default)
var err error
if session != nil {
returnValue.Elem().Set(reflect.ValueOf(session).Elem().Addr().Convert(*returnType.ReturnOutType))
} else {
//err = utils.NewError("GoMybatis", "Create Session fail.arg session not exist!")
session = sessionFactory.NewSession(beanName, SessionType_Default)
}
returnValue.Elem().Set(reflect.ValueOf(session).Elem().Addr().Convert(*returnType.ReturnOutType))
return buildReturnValues(returnType, returnValue, err)
}
return proxyFunc
Expand Down

0 comments on commit 414196a

Please sign in to comment.