mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Transaction manager. Adding optional isolation level argument.
--HG-- branch : 1.x
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user