Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unspecified Error" when reading multiple files sequentially. #196

Open
MountainBanjo opened this issue Jun 26, 2021 · 0 comments
Open

"Unspecified Error" when reading multiple files sequentially. #196

MountainBanjo opened this issue Jun 26, 2021 · 0 comments

Comments

@MountainBanjo
Copy link

MountainBanjo commented Jun 26, 2021

Reading multiple files with multiple worksheets in a row (approx 100 files, approx 40 worksheets in each file).

I will get "Unspecified Error" as I'm disposing and creating ExcelQueryFactories, then querying either a specific worksheet, or getting the worksheet names collection immediately after creating a new factory.

However, if I catch the error, I can work around it by running garbage collection and recreating a new ExcelQueryFactory.

_excelQueryFactory.Dispose();
Thread.Sleep(500);
_excelQueryFactory = null;
Thread.Sleep(500);
System.GC.Collect();
Thread.Sleep(500);

And then instantiate a new ExcelQueryFactory object:

...
_excelQueryFactory = new ExcelQueryFactory(xlCache.FullName)
{
UsePersistentConnection = true,
TrimSpaces = TrimSpacesType.Both,
ReadOnly = true
};


Notes:  This just started today (6/25/2021), but the size of my data in these sheets has been steadily growing.

Version: 1.11.0.0
Runtime version v2.0.50727

Other notable exception properties:

Source: Microsoft Access Database Engine

StackTrace:

> Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
>    at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
>    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
>    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
>    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
>    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
>    at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
>    at System.Data.OleDb.OleDbConnection.Open()
>    at LinqToExcel.Query.ExcelUtilities.GetWorksheetNames(ExcelQueryArgs args)
>    at LinqToExcel.Query.ExcelUtilities.GetWorksheetNames(String fileName, ExcelQueryArgs args)
>    at LinqToExcel.ExcelQueryFactory.GetWorksheetNames()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant