mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Disposing the current transaction if Demand() is called right after Cancel()
--HG-- branch : 1.x
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user