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

NullReferenceException at GdsDatabase.Write(Int32 value) [DNET291] #302

Closed
firebird-automations opened this issue Jan 27, 2010 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: lifeng liang (lifeng)

Relate to DNET421

I am using fb for my web site, and found a bug of its .net provider. The same page same code ran into this problem about once per week. I compiled fb .net provider 2.5.1 as DEBUG mode, and following is the stack track of it:

System.NullReferenceException:
at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.Write(Int32 value) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\Client\Managed\Version10\GdsDatabase.cs:line 978
at FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.BeginTransaction(TransactionParameterBuffer tpb) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\Client\Managed\Version10\GdsTransaction.cs:line 137
at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.BeginTransaction(TransactionParameterBuffer tpb) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\Client\Managed\Version10\GdsDatabase.cs:line 556
at FirebirdSql.Data.FirebirdClient.FbTransaction.BeginTransaction() location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbTransaction.cs:line 363
at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbCommand.cs:line 1111
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbCommand.cs:line 1174
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbCommand.cs:line 551
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior) location D:\Coding\Projects\FirebirdClient-2.5.1-src\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbCommand.cs:line 621
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

Since GdsDatabase.Write only has one line code and the parameter value could not be null, it should be outputStream equels null somehow. And I checked all usages of outputStream, I guess GdsDatabase.Detach was called sometime and might related of connection pooling.

The following is my connection string:
User=XXX;Password=BBB;Database=studio.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=UNICODE_FSS;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0

@firebird-automations
Copy link
Author

Commented by: Sebastian Brandt (csbac)

I'm not sure whether this is the same problem, yet, seems very similar.

FirebirdSql.Data.FirebirdClient.dll 2.5.0.0
(oh, there should be a newer version)
NHibernate.dll 2.0.1.4000

In an app that usually runs w/o any problems, now and then I get
NHibernate.ADOException: could not execute query
[select ...]
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.BeginTransaction(TransactionParameterBuffer tpb)
bei FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.BeginTransaction(TransactionParameterBuffer tpb)
bei FirebirdSql.Data.FirebirdClient.FbTransaction.BeginTransaction()
bei FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior)
bei System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
bei NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
bei NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
bei NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
bei NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
bei NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
bei NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
bei NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes)
bei NHibernate.Hql.Classic.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
bei NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results)
bei NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results)
bei NHibernate.Impl.SessionImpl.List[T](String query, QueryParameters parameters)
bei NHibernate.Impl.QueryImpl.List[T]()

This is in the context of NHibernate, yet, the query in itself and the parameters are shown as valid. Also, the query itself is not run in a tranaction context (no changes done to the database).

I'll try again with the 2.5.2.0 version.

Yours,
Sebastian

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue relate to DNET421 [ DNET421 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Resolved as part of DNET421.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.7-next [ 10462 ]

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

No branches or pull requests

2 participants