Bug #51309 pooling=false; gives Object Reference is not set to an instance of an object
Submitted: 19 Feb 2010 8:46 Modified: 19 Mar 2010 13:02
Reporter: D Srinivas Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:.Net Connector 5.2.6.0 OS:Microsoft Windows
Assigned to: Assigned Account CPU Architecture:Any

[19 Feb 2010 8:46] D Srinivas
Description:
Once the "pooling=false;" is added to the connection string we are getting "Object Reference is not set to an instance of an object" error. Otherwise it is working fine. Please let me know is this a Mysql Connector bug or code error. There are no blob object in select statement.

The following is the stack trace for your reference:

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   MySql.Data.MySqlClient.MySqlStream.Read(Byte[] buffer, Int32 offset, Int32 count) +518
   MySql.Data.MySqlClient.MySqlStream.ReadByte() +150
   MySql.Data.MySqlClient.MySqlStream.LoadPacket() +121
   MySql.Data.MySqlClient.MySqlStream.OpenPacket() +117
   MySql.Data.MySqlClient.NativeDriver.Open() +926
   MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +117
   MySql.Data.MySqlClient.MySqlConnection.Open() +1404
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94
   ASP.client_forum_aspx.bindData() +152
   ASP.client_forum_aspx.Page_Load(Object sender, EventArgs e) +156
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

How to repeat:
add pooling=false; to connection string. This happens with .Net Connector version 5.2.6.0.

Suggested fix:
No comments
[19 Feb 2010 9:09] Tonci Grgin
Hi Srinivas and thanks for your report.

As current development version is 6.3 I have to ask you to use at least c/NET 6.2.2 and retest. 5.2.6 is way too old.
[19 Feb 2010 9:11] Tonci Grgin
Btw, I had to be a wizard to figure bug out of just stack trace... You always have to attach small but complete test case which produces the error preferably every time we run it.
[19 Feb 2010 11:03] D Srinivas
Hi Tonci,

Thanks for your quick response.

Is 6.2.2 Connect/NET works with MySQL 5.0.27 Server? Is it released? If so are there any special settings required in our web.config? Please let us know so that we start working on 6.2.2 Connect/NET.

Yes, same error is coming once we set "pooling=false". Let me clarify from you one more thing here that shall we have to create any separate connection externally through our code when we set "pooling=false" or otherwise the usual process by instantiating the connection we can use the connection.

Have a great day.

Thanks once again.
[19 Feb 2010 13:02] Tonci Grgin
Srinivas:

> Is 6.2.2 Connect/NET works with MySQL 5.0.27 Server?

Yes

> Is it released?

Yes.

> If so are there any special settings required in our web.config? Please let us know so that we start working on 6.2.2 Connect/NET.

This is unknown to me as I do not have your application. You should consider downloading the connector and checking on tests in "Test" folder.

> Yes, same error is coming once we set "pooling=false". Let me clarify from you one more thing here that shall we have to create any separate connection externally through our code when we set "pooling=false" or otherwise the usual process by instantiating the connection we can use the connection.

I do not get this at all, sorry... You are free to use or not to use pooling. The only thing you might pay attention on is max_connections server variable. However, new versions of c/NET do include completely new code for managing pools and timeouts so that might help you. You can find more in changelog and manual.
[20 Mar 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".