Transaction manager. Adding optional isolation level argument.

--HG--
branch : 1.x
This commit is contained in:
Piotr Szmyd
2013-03-27 21:37:18 +01:00
parent 55e5b71da3
commit 6664483b02
3 changed files with 7 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Data;
using System.Diagnostics;
using System.Linq;
using Autofac;
@@ -100,7 +101,7 @@ namespace Orchard.Tests.ContentManagement {
public void Demand() {
}
public void RequireNew() {
public void RequireNew(IsolationLevel level) {
}
public void Cancel() {

View File

@@ -37,7 +37,7 @@ namespace Orchard.Data {
}
}
void ITransactionManager.RequireNew() {
void ITransactionManager.RequireNew(IsolationLevel level) {
EnsureSession();
if (_cancelled) {
@@ -52,7 +52,7 @@ namespace Orchard.Data {
}
Logger.Debug("Creating transaction on RequireNew");
_transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted);
_transaction = _session.BeginTransaction(level);
}
void ITransactionManager.Cancel() {

View File

@@ -1,10 +1,11 @@
using System.Web.Mvc;
using System.Data;
using System.Web.Mvc;
using Orchard.Mvc.Filters;
namespace Orchard.Data {
public interface ITransactionManager : IDependency {
void Demand();
void RequireNew();
void RequireNew(IsolationLevel level = IsolationLevel.ReadCommitted);
void Cancel();
}