xorm icon indicating copy to clipboard operation
xorm copied to clipboard

how to open session autoclose flag with xorm.engine

Open godcong opened this issue 6 years ago • 1 comments

now i used engine.Where("") to create an autoclose session.

but, the souce looks not very good. does any suggestions for this?

if has some function like:

engine.NewAutoCloseSession()

or

session.AutoClose()

that is great!

godcong avatar Oct 14 '19 04:10 godcong

It's unnecessary to close session manually if you use engine.Where.... Only when you use sess := engine.NewSession(), you should ensure you revoked sess.Close() before you leave the scope.

lunny avatar Oct 14 '19 05:10 lunny