Disposing the current transaction if Demand() is called right after Cancel()

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-28 14:07:01 -07:00
parent 838b00f8e0
commit ba50ceee3c

View File

@@ -21,6 +21,17 @@ namespace Orchard.Data {
public ILogger Logger { get; set; }
void ITransactionManager.Demand() {
if(_cancelled) {
try {
_scope.Dispose();
}
catch {
// swallowing the exception
}
_scope = null;
}
if (_scope == null) {
Logger.Debug("Creating transaction on Demand");
_scope = new TransactionScope(