Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Data.OleDb.OleDbConnectionInternal..ctor: Unspecified error

After several hours (~6 hours Win7 64bit, ~24hours WinXP) of running multi-threaded (.NET Framework 3.5 SP1 WinForms) desktop application using .mdb files as backend I'm getting the following runtime error:

Exception -> Unspecified error

StackTrace ->

at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

at System.Data.OleDb.OleDbConnection.Open()

at NetworkManager.SearchInputFileHandler.GetInputRows(SearchProgramTypeEnumeration programType, Int32 startRowNum, Int32 rowsQty, Boolean setupInProgress, Boolean filterOutUninitializedRows)

It looks like this is an OleDbProvider bug.

Have you seen/experienced something like that?

Context:

(1) I do exclusively use

using (OleDbConnection cnn = new OleDbConnection("{{mymdbConnectionStringHere}}")) {

cnn.Open();

...

}

(2) I do use IN clause in some select SQL expressions to point to external MDB tables.

I guess the issues is caused by case (2). Although that's still a hypothesis here to check (some code fixes are needed in the core code of my application, and I'm considring now will that be worth fixing, or I should better switch to MS SQL backend.)

Thank you.

like image 940
ShamilS Avatar asked Oct 29 '10 09:10

ShamilS


2 Answers

Was there any progress in finding out the solution for this issue or more stabe workaround?

I have similar problem in ASP.NET application with reading Excel file. It is only visible in production environment where many users attempt to process different XLS files on the server side. After recycling IIS service at night there are around ~200 requests (to open excel) that hang JET engine. The problem is that all subsequent attempts fail so retry logic wouldn't help much. Only IIS reset heals the problem.

From the investigation I've made there are several options to take:

  1. Switch to other library to read XLS files: Excel OLE Automation - requires Excel to be installed on server and having many requests would create many instances of Excel process that's not acceptable. 3rd party library - are any of these free?
  2. Move excel processing to separate process. Exchange data with some other format as XML.
  3. Use some sort of smart handling to control number of OLEDB open and closes going on in the process.

Any thoughts?

like image 55
void Avatar answered Sep 20 '22 12:09

void


I had the same problem. Recyling only the application pool in IIS worked for me.

like image 33
yey Avatar answered Sep 18 '22 12:09

yey