public bool IfUserTableExists(string userTableName)
{
string tableName = GetUserTableNameAsString(userTableName);
_sync_openTablesHolder.EnterWriteLock();
try
{
if (_openTablesHolder.ContainsKey(tableName))
return true;
////Searching on the disk
byte[] btTableName = this.GetUserTableNameAsByte(userTableName);
var row = LTrie.GetKey(btTableName, false);
return row.Exists;
}
catch (System.Exception ex)
{
throw ex;
}
finally
{
_sync_openTablesHolder.ExitWriteLock();
}
////First trying to acquire memory storage, without lock but inside of "ignoring" try-catch, if answer is failed refer to the disk
//_sync_openTablesHolder.EnterReadLock();
//try
//{
// if (_openTablesHolder.ContainsKey(tableName))
// return true;
//}
//finally
//{
// _sync_openTablesHolder.ExitReadLock();
//}
//////Searching on the disk
//byte[] btTableName = this.GetUserTableNameAsByte(userTableName);
//var row = LTrie.GetKey(btTableName, true);
//return row.Exists;
}