Lost Connection to MySQL server during query
Posted: Fri 12 Sep 2008 13:19
I've got a select statement that should return little over 10,000 records with 10 columns. In MySQL query browser, it fetches this data in 0.1428seconds.
When I try this in vb.net, I keep getting an error message saying lost connection to MySql server during query. When I dig into details, I see errorCode -2147467259
I have a try catch block where I check to see if the mysqlconnection is closed, and if so, i open it and try the mysqldatatable("select statement", connection") assignment.
Error occurs when I make the mysqldatabale.active = true.
Just to be safe, I made the MaxConnectionAge = 300000, still same problem occurs.
Any thoughts?
Stack trace is pasted below.
StackTrace: " at CoreLab.MySql.a7.a(Byte[] A_0, Int32 A_1, Int32 A_2)
at CoreLab.MySql.a7.a()
at CoreLab.MySql.a7.b(Byte[] A_0)
at CoreLab.MySql.b.a(Byte[] A_0)
at CoreLab.MySql.b.a(Byte[] A_0, Boolean A_1)
at CoreLab.MySql.bf.f()
at CoreLab.MySql.x.b(Boolean A_0)
at CoreLab.MySql.MySqlDataReader.a(Boolean A_0)
at CoreLab.MySql.MySqlDataReader.Close()
at CoreLab.Common.DbDataTable.k()
at CoreLab.Common.DbDataTable.h()
at CoreLab.Common.DbDataTable.CancelFetch()
at CoreLab.Common.DbDataTable.a(Int32 A_0, Boolean A_1)
at CoreLab.Common.DbDataTable.b(Boolean A_0)
at CoreLab.Common.DbDataTable.c()
at CoreLab.Common.DbDataTable.Open()
at CoreLab.Common.DbDataTable.set_Active(Boolean value)
at ExchangeFeeEstimator.Form1.RepopulateTable() in C:\Documents and Settings\CANDCTrading\My Documents\Visual Studio 2005\Projects\ExchangeFeeEstimator\ExchangeFeeEstimator\Form1.vb:line 56
at ExchangeFeeEstimator.Form1.SimpleButton1_Click(Object sender, EventArgs e) in C:\Documents and Settings\CANDCTrading\My Documents\Visual Studio 2005\Projects\ExchangeFeeEstimator\ExchangeFeeEstimator\Form1.vb:line 134
at System.Windows.Forms.Control.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at ExchangeFeeEstimator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"
When I try this in vb.net, I keep getting an error message saying lost connection to MySql server during query. When I dig into details, I see errorCode -2147467259
I have a try catch block where I check to see if the mysqlconnection is closed, and if so, i open it and try the mysqldatatable("select statement", connection") assignment.
Error occurs when I make the mysqldatabale.active = true.
Just to be safe, I made the MaxConnectionAge = 300000, still same problem occurs.
Any thoughts?
Stack trace is pasted below.
StackTrace: " at CoreLab.MySql.a7.a(Byte[] A_0, Int32 A_1, Int32 A_2)
at CoreLab.MySql.a7.a()
at CoreLab.MySql.a7.b(Byte[] A_0)
at CoreLab.MySql.b.a(Byte[] A_0)
at CoreLab.MySql.b.a(Byte[] A_0, Boolean A_1)
at CoreLab.MySql.bf.f()
at CoreLab.MySql.x.b(Boolean A_0)
at CoreLab.MySql.MySqlDataReader.a(Boolean A_0)
at CoreLab.MySql.MySqlDataReader.Close()
at CoreLab.Common.DbDataTable.k()
at CoreLab.Common.DbDataTable.h()
at CoreLab.Common.DbDataTable.CancelFetch()
at CoreLab.Common.DbDataTable.a(Int32 A_0, Boolean A_1)
at CoreLab.Common.DbDataTable.b(Boolean A_0)
at CoreLab.Common.DbDataTable.c()
at CoreLab.Common.DbDataTable.Open()
at CoreLab.Common.DbDataTable.set_Active(Boolean value)
at ExchangeFeeEstimator.Form1.RepopulateTable() in C:\Documents and Settings\CANDCTrading\My Documents\Visual Studio 2005\Projects\ExchangeFeeEstimator\ExchangeFeeEstimator\Form1.vb:line 56
at ExchangeFeeEstimator.Form1.SimpleButton1_Click(Object sender, EventArgs e) in C:\Documents and Settings\CANDCTrading\My Documents\Visual Studio 2005\Projects\ExchangeFeeEstimator\ExchangeFeeEstimator\Form1.vb:line 134
at System.Windows.Forms.Control.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at ExchangeFeeEstimator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"