session add method IsInTx (#1863)
Co-authored-by: whybangbang <525484036@qq.com> Reviewed-on: https://gitea.com/xorm/xorm/pulls/1863 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: whybangbang <whybangbang@noreply.gitea.io> Co-committed-by: whybangbang <whybangbang@noreply.gitea.io>
This commit is contained in:
parent
4629bb1717
commit
ffac8e3577
|
@ -84,3 +84,8 @@ func (session *Session) Commit() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// if current session is in a transaction
|
||||
func (session *Session) IsInTx() bool {
|
||||
return !session.isAutoCommit
|
||||
}
|
Loading…
Reference in New Issue