diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-13 00:58:46 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-13 00:58:46 -0500 |
commit | 6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68 (patch) | |
tree | 02b1617a75095fe5f072533708e920fbac477d34 /models/models.go | |
parent | b99c4baab22ec080906582703809e5ec12bae3f9 (diff) | |
download | gitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.tar.gz gitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.zip |
code fix #941 caution: undertest
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go index 141e3ac497..1cb7229645 100644 --- a/models/models.go +++ b/models/models.go @@ -24,12 +24,22 @@ import ( type Engine interface { Delete(interface{}) (int64, error) Exec(string, ...interface{}) (sql.Result, error) + Find(interface{}, ...interface{}) error Get(interface{}) (bool, error) Insert(...interface{}) (int64, error) + InsertOne(interface{}) (int64, error) Id(interface{}) *xorm.Session + Sql(string, ...interface{}) *xorm.Session Where(string, ...interface{}) *xorm.Session } +func sessionRelease(sess *xorm.Session) { + if !sess.IsCommitedOrRollbacked { + sess.Rollback() + } + sess.Close() +} + var ( x *xorm.Engine tables []interface{} |