mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Transaction manager. Changing optional parameter to overloaded methods.
--HG-- branch : 1.x
This commit is contained in:
@@ -101,6 +101,9 @@ namespace Orchard.Tests.ContentManagement {
|
||||
public void Demand() {
|
||||
}
|
||||
|
||||
public void RequireNew() {
|
||||
}
|
||||
|
||||
public void RequireNew(IsolationLevel level) {
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,10 @@ namespace Orchard.Data {
|
||||
}
|
||||
}
|
||||
|
||||
void ITransactionManager.RequireNew() {
|
||||
((ITransactionManager)this).RequireNew(IsolationLevel.ReadCommitted);
|
||||
}
|
||||
|
||||
void ITransactionManager.RequireNew(IsolationLevel level) {
|
||||
EnsureSession();
|
||||
|
||||
@@ -51,7 +55,7 @@ namespace Orchard.Data {
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Debug("Creating transaction on RequireNew");
|
||||
Logger.Debug("Creating new transaction with isolation level {0}", level);
|
||||
_transaction = _session.BeginTransaction(level);
|
||||
}
|
||||
|
||||
@@ -84,7 +88,7 @@ namespace Orchard.Data {
|
||||
}
|
||||
|
||||
var sessionFactory = _sessionFactoryHolder.GetSessionFactory();
|
||||
Logger.Information("Openning database session");
|
||||
Logger.Information("Opening database session");
|
||||
_session = sessionFactory.OpenSession(new SessionInterceptor());
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ using Orchard.Mvc.Filters;
|
||||
namespace Orchard.Data {
|
||||
public interface ITransactionManager : IDependency {
|
||||
void Demand();
|
||||
void RequireNew(IsolationLevel level = IsolationLevel.ReadCommitted);
|
||||
void RequireNew();
|
||||
void RequireNew(IsolationLevel level);
|
||||
void Cancel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user