Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

Created Unassigned: Multithreaded Read [12936]

$
0
0
There seems to be an issue in Excel/Log/LogManager.cs if you concurrently read from multiple different xlsx files.

I fixed the issue by moving the sync-lock to cover up ContainsKey-Check too

From

```
public static ILog Log(string objectName)
{
ILog result = null;

if (_dictionary.ContainsKey(objectName))
result = _dictionary[objectName];

if (result == null)
{
lock (_sync)
{
result = Excel.Log.Log.GetLoggerFor(objectName);
_dictionary.Add(objectName, result);
}
}

return result;
}
```

to

```
public static ILog Log(string objectName)
{
ILog result = null;

lock (_sync)
{
if (_dictionary.ContainsKey(objectName))
result = _dictionary[objectName];

if (result == null)
{
result = Excel.Log.Log.GetLoggerFor(objectName);
_dictionary.Add(objectName, result);
}
}

return result;
}
```

Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>