Page 1 of 1

Error at Update time

Posted: Sat 09 Feb 2008 08:51
by Amish
Hi Alexey...

I am having some problem with Update command of Mysqldataadapter of Mydirect.Net.

I am updating a row in which a field contains 3 mb data.

Data type of this field is LONGTEXT.

Now when i insert this row,It gives error message as below.

"Lost connection to MySQL server during query"

CoreLab.MySql.MySqlException

errorcode:2013

I searched and changed some variables in Mysql server as below.

wait_timeout
max_allowed_packet
write_timeOut
read_timeout

I set all this field to proper amount of time.

--->I saw a property of Mysqladapter named "UpdateBatchtime".Do i need to change this property???

Thanks
Amish

Posted: Sat 09 Feb 2008 11:03
by Amish
Sorry Property Name for dataadapter is "UpdateBatchSize" above...

Posted: Mon 11 Feb 2008 12:40
by Alexey.mdr
Hello Amish,

Try to increase the CommandTimeout property. This should solve the problem.

Posted: Tue 12 Feb 2008 10:23
by Amish
Hi..

I tried using MysqlCommand.commandtimeout property as you suggested but it didnt work....

Below is the stack trace which gives exception when i use command.executenonquery


at CoreLab.MySql.a5.d(Byte[] A_0, Int32 A_1, Int32 A_2)
at CoreLab.MySql.a5.b(Byte[] A_0, Int32 A_1, Int32 A_2)
at CoreLab.MySql.b.a(at A_0, Byte[] A_1, Int32 A_2, Boolean A_3)
at CoreLab.MySql.b.a(Byte[] A_0, Int32 A_1, Boolean A_2)
at CoreLab.MySql.ab.e()
at CoreLab.MySql.ab.o()
at CoreLab.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at CoreLab.Common.DbCommandBase.ExecuteNonQuery()

Hope this can help you suggesting solution

Thanks
Amish

Posted: Tue 12 Feb 2008 12:12
by Alexey.mdr
Hello Amish!
To solve the problem, try setting:

Code: Select all

[mysqld]
max_allowed_packet=167772160
in the MySQL server configuration. Please ensure that this property has changed indeed (you can use 'show variables' command).

Posted: Tue 12 Feb 2008 13:43
by Amish
Its done....

But i was not able do it the way you suggested.

I changed the variable max_allowed_packet to the the value you described above in my.ini file in Program files of MYSQL 4.1.

I failed to do it in mysql command line.

Some syntax problem was there.

Anyways..

Thank you very much for your help.

Posted: Tue 12 Feb 2008 14:59
by Alexey.mdr
Welcome!
We are glad that the problem is solved.