Refresh ends up with LostConnection

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Refresh ends up with LostConnection

Post by Zero-G. » Tue 02 Feb 2010 11:08

Hey

Using dotConnect for MySQL v. 5.50.57.0

When trying to run the following code:

Code: Select all

        LinqProvider.RefreshProvider(Data.Linq.RefreshMode.KeepChanges, LinqProvider.GetProvider.Auftrags)
        Me.bsKundenstamm.DataSource = From Query In LinqProvider.GetProvider.Kundenstamms _
                                          Order By Query.Nname, Query.Vname

Code: Select all

 Public Shared Sub RefreshProvider(ByVal mode As System.Data.Linq.RefreshMode, ByVal entites As System.Collections.IEnumerable)
        GetProvider.Refresh(mode, entites)
    End Sub
When the Refresh Command is fired, then it hangs up after about 2 Minutes with Lost connection to MySQL server during query error.
Any tip to this?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 02 Feb 2010 15:50

Please make sure there is no uncommited transactions at the database you are trying to refresh.
Stop the execution of the program when it hangs and send us the call stack, this can help to identify the problem.

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Wed 03 Feb 2010 08:58

Hey

No transaction is running. The Stacktrace:
Message: Lost connection to MySQL server during query
Inner Message: Devart.Common.o: Read less bytes than expected.
bei Devart.Common.ar.c(Byte[] A_0, Int32 A_1, Int32 A_2)
bei Devart.Common.s.e(Byte[] A_0, Int32 A_1, Int32 A_2)
StackTrace: bei Devart.Common.ai.a(Exception A_0)
bei Devart.Data.MySql.bh.a(Exception A_0)
bei Devart.Common.s.e(Byte[] A_0, Int32 A_1, Int32 A_2)
bei Devart.Data.MySql.bk.a(Int32& A_0, Int32& A_1)
bei Devart.Data.MySql.bk.a(Byte[] A_0, Int32 A_1, Int32 A_2)
bei Devart.Data.MySql.bk.a()
bei Devart.Data.MySql.bk.d(Boolean A_0)
bei Devart.Data.MySql.v.a(Byte[] A_0)
bei Devart.Data.MySql.v.a(Byte[] A_0, Boolean A_1)
bei Devart.Data.MySql.ao.f()
bei Devart.Data.MySql.a2.b(Boolean A_0)
bei Devart.Data.MySql.MySqlDataReader.a(Boolean A_0)
bei Devart.Data.MySql.MySqlDataReader.Close()
bei Devart.Data.Linq.Provider.ObjectReader`1.Dispose()
bei Devart.Data.Linq.DataContext.Refresh(RefreshMode mode, IEnumerable entities)
bei VOPT.LinqProvider.RefreshProvider(RefreshMode mode, IEnumerable entites) in C:\Users\Intelli Soft\Documents\Visual Studio 2008\Projects\Visual OPT .NET - Kopie\Vopt\VOPT\Component\LinqProvider.vb:Zeile 28.
bei VOPT.usrKundenstamm.ResetKundenstamm() in C:\Users\Intelli Soft\Documents\Visual Studio 2008\Projects\Visual OPT .NET - Kopie\Vopt\VOPT\UserControl\usrKundenstamm.vb:Zeile 587.
bei VOPT.usrKundenstamm.cmdZurückSetzen_Click(Object sender, EventArgs e) in C:\Users\Intelli Soft\Documents\Visual Studio 2008\Projects\Visual OPT .NET - Kopie\Vopt\VOPT\UserControl\usrKundenstamm.vb:Zeile 680.
bei Janus.Windows.Ribbon.CommandBase.OnClick(CommandEventArgs e)
bei Janus.Windows.Ribbon.CommandBase.InvokeOnClick()
bei Janus.Windows.Ribbon.ButtonCommand.InvokeOnClick()
bei Janus.Windows.Ribbon.JNSD.OnMouseUp(MouseEventArgs e)
bei Janus.Windows.Ribbon.JNSAO.OnMouseUp(MouseEventArgs e)
bei Janus.Windows.Ribbon.JNSCE.OnMouseUp(MouseEventArgs e)
bei Janus.Windows.Ribbon.JNSCM.a(MouseEventArgs )
bei Janus.Windows.Ribbon.Ribbon.OnMouseUp(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei Janus.Windows.Ribbon.Ribbon.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 03 Feb 2010 16:15

I've tried to reproduce the issue with your Auftrag table definition and failed.
Could you make a simple test project?

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Thu 04 Feb 2010 09:08

Hey

I am sorry, but I can't send you testdata from the db, because the data is in production mode... (but in the auftrag table, there are about 1 000 000 rows with data in it)
OK, but I think I found out, where the problem is.
The auftrag is associated with the auftragdetails table. I bind the auftrag table by a bindingsource to some of my Textboxes and so on. And (without calling any code) also some columns of the auftragdetails are visual bound to a textbox. - So, it comes to a deffered loading. - And when then calling the refresh - only or first - to the auftrag table, then the error appears. - Maybe it has something to do, that the auftragdetails has also values!?

Hope you understand what I mean. - THX

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 08 Feb 2010 16:21

I'm not sure the problem is in detail records.
Could you please trace the query causing the error?
For this you can, for example, add the following line of code before the GetProvider.Refresh() call:

Code: Select all

Dim SB As New StringBuilder
Context.Log = New System.IO.StringWriter(SB)
If possible, please post it here or send it to me.

Post Reply