nhibernate CreateSQLQuery 事务提交问题
一但使用CreateSQLQuery查询或者更新时,不管执不执行scope.Complete(),数据都已经提交,取消CreateSQLQuery则正常。
是CreateSQLQuery问题还是不支持事务?
代码如下
using (var scope = new TransactionScope(TransactionScopeOption.Required))
{
_saleRepository.Update(order);
_session.CreateSQLQuery(sql).ExecuteUpdate();
scope.Complete()
}