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:
whybangbang 2021-02-03 23:27:07 +08:00 committed by Lunny Xiao
parent 4629bb1717
commit ffac8e3577
1 changed files with 5 additions and 0 deletions

View File

@ -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
}