|
[
Permalink
| « Hide
]
Gerdus van Zyl added a comment - 14/May/10 09:20 AM
Forgot to mention the exception isn't catchable, as in visual studio does not jump to the line in my program that gave the exception.
I observed the same behavior. I don't know really what caused it in my case. It seems to happen kind of randomly, but it only when I have several threads that use the connector to query the database at the same time.
It seems that the FbConnectionInternal.preparedCommands field is cleared during the execution of the FbConnectionInternalRemovePerparedCommand, which causes an exception because the variable i is greater than zero but the size of the collection is zero. I would have thought that this field was modified by another thread, but I'm not sure. I don't understand how another thread could modify this field, since it is the garbage collector that calls this method when the exception occurs, and it shouldn't be possible to use an object while it is being garbage collected. But I don't really see how the code in the loop could clear this field either. So yeah, I don't really have a clue of why this happens. It looks like very strange to me. If you want to catch the exception in visual studio, type CTR + ALT + E in visual studio and check everything in the dialog. Then if the exception is thrown, the debugger will stop at this point. EDIT: Actually, after spending some more time, I found a place where I forgot to call dispose() on an FbCommand in my code. After adding that call and running tests that used to fail sometimes before, they don't fail anymore. It used to happen kind of randomly, so I cannot be sure that the problem is really solved, but it seems to work now. So yeah, Gerdus van Zyl is probably right when saying that the problem is caused by not calling dispose() an an FbCommand before the connection is closed. Same problem. But during work with Entity Framework.
It was attempt to transfer project from MS SQL to Firebird. In MS SQL all was fine. So it is not about manual calling of Dispose() on any Commands. In the same time only one thread access Entity Context so it is not about multi-threading. Problems with reproduction. Such kind of problems prevent from using of Firebird in any real .NET projects based on Entity Framework. Handling errors in some specific command/query may have work-around. But such kind of errors like this one don't have realistic work-around. I think that priority should be changed to Blocker or Critical. I get sometimes a strange error while I use a program which was created with provider 2.5.1. Now I changed the version to 2.6 and get following error spontaneously, I can't say when and why it happens. Maybe you will know. It seems not to be cause by my application, in addition to that this error does not occur when I use the old provider version.
Error (sorry, but in german): [4208] LPCS->Unhandled EXCEPTION -> OnCurrentDomain_UnhandledException [4208] LPCS->EXCEPTION: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. [4208] bei FirebirdSql.Data.FirebirdClient.FbConnectionInternal.RemovePreparedCommand(FbCommand command) [4208] bei FirebirdSql.Data.FirebirdClient.FbCommand.Release() [4208] bei FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean disposing) [4208] bei System.ComponentModel.Component.Finalize() [4208] LPCS->System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. [4208] bei FirebirdSql.Data.FirebirdClient.FbConnectionInternal.RemovePreparedCommand(FbCommand command) [4208] bei FirebirdSql.Data.FirebirdClient.FbCommand.Release() [4208] bei FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean disposing) [4208] bei System.ComponentModel.Component.Finalize() recently upgraded to 2.6.5 in conjunction with .net version 4 and problem still exists. The problem is intermittent as all good heisenbugs should be.
updated to inform that bug still exist in newest version and in .net4/vs2010
I am using asp.net 4.0 and firebird 2.5 in my web site project. And i use firebird .net provider (for sure) My web site is being used by only 5 - 10 users by now. I tried .net provider 2.5.2 and 2.6.5 but for both of them, I am getting the following exception for most of the time .... Exception: System.NullReferenceException Message: Object reference not set to an instance of an object. StackTrace: at FirebirdSql.Data.FirebirdClient.FbCommand.RollbackImplicitTransaction() at FirebirdSql.Data.FirebirdClient.FbCommand.Release() at FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean disposing) at System.ComponentModel.Component.Finalize() Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at FirebirdSql.Data.FirebirdClient.FbCommand.RollbackImplicitTransaction() at FirebirdSql.Data.FirebirdClient.FbCommand.Release() at FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean) at System.ComponentModel.Component.Finalize() But when only one user is using the site , no exception occurs, and when a second user enters the site, just at that time the exception occurs and goes on occurring as long as more than one user is using the site. I think there is problem in the user session management mechanism of the firebird .net provider ... Could any one give me any advice or solution for this problem ? Happening to me as well but I am calling dispose() or using usings in the right places. Very random and hard to track down.
We are using FB 2.5.1 with the provider 2.7. 7 in a Windows 7, .net 4, visual studio 2010
environment and we still got those exceptions. It's hard to track down why the exception occurs. It's once in a while but very unpleasant... I hope that other can point me out what they did to solve this problem |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||