Shamil Salakhetdinov
shamil at smsconsulting.spb.ru
Fri Oct 29 08:59:41 CDT 2010
Hi John -- Thank you for your reply. I guess "connections leaking" happens in my case because of the usage of IN clause and because of bug in OleDbProvider happening in that context: "automatic connection" opened somewhere inside OleDbProvider isn't getting closed - something like that.... In general when you use: using (OleDbConnection cnn = new OleDbConnection("{{mymdbConnectionStringHere}}")) { cnn.Open(); ... } then there is no "connections leaking" - GC works well. The same is true for SQL Server data provider also. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 29 ??????? 2010 ?. 14:31 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Unspecified Error I've never programmed against an MDB. Are you opening and closing the connection repeatedly? I did have an issue where I was "leaking" connections (kinda) and ran out of connections to SQL Server. Basically the garbage collector runs when it thinks it needs to. If you don't force a cleanup of non-native (to .Net) objects such as SQL Server connections, then the GC doesn't know it needs to clean up and doesn't do so. I had to build a dispose method for my classes and intentionally call that dispose method as the class was closed, which forced the GC to release the non-native objects immediately instead of whenever it decided to. John W. Colby www.ColbyConsulting.com On 10/29/2010 5:05 AM, Shamil Salakhetdinov wrote: > Hi All -- > > 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(DbConnection > Option s options, Object poolGroupProviderInfo, DbConnectionPool pool, > DbConnection > owningObject) > at > System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection > (DbCon nection owningConnection, DbConnectionPoolGroup poolGroup) > at > System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnectio > n > owningConnection) > at > System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnectio > n outerConnection, DbConnectionFactory connectionFactory) > at System.Data.OleDb.OleDbConnection.Open() > at > NetworkManager.SearchInputFileHandler.GetInputRows(SearchProgramTypeEn > umerat ion 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 considreing now will that be worth fixing, > or I should better switch to MS SQL backend.) > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com