public static void DisposeScope(int transactionScopeId, Guid rootRequestId, bool doCompact = true)
{
Task.Run(() =>
{
Dev2Logger.Log.Debug("DISPOSING - Transactional scope ID = " + transactionScopeId);
try
{
lock(Lock)
{
IList<Guid> theList;
if(RegistrationRoster.TryGetValue(transactionScopeId, out theList))
{
theList.Remove(rootRequestId);
BinaryDataListStorageLayer.RemoveAll(theList);
// finally reset
IList<Guid> dummy;
RegistrationRoster.TryRemove(transactionScopeId, out dummy);
// now remove children ;)
var keyList = ActivityThreadToParentThreadId.Keys.ToList();
foreach(var key in keyList)
{
if(key == transactionScopeId)
{
int dummyInt;
ActivityThreadToParentThreadId.TryRemove(transactionScopeId, out dummyInt);
}
}
}
}
}
catch(Exception e)
{
Dev2Logger.Log.Error("DataListRegistar", e);
}
finally
{
// now we need to pack memory to reclaim space ;)
if(doCompact)
{
// turned force off ;)
BinaryDataListStorageLayer.CompactMemory(true);
}
}
});
}