单表事务
session := torm.GetDbInstance("default", "writer").GetSession() //指定实例
defer session.Close() //需注意手动关闭session
session.Begin() //开启事务
dao := NewDbtestDao(session) //传入session
param := torm.CastToParamIn([]int{1})
data, err := dao.Get(param)
row := data[0]
row.Param1 = 100
row.Param2 = "update1"
dao.Update(&row)
param = torm.CastToParamIn([]int{2})
data, err = dao.Get(param)
row = data[0]
dao.Delete(&row)
e := session.Commit() //不commit 会自动rollback
if e != nil {
session.Rollback()
}