FetchAll = false causes connection lost
Posted: Thu 17 May 2007 04:08
Hi
I have an advanced grid in which client is able to do sorting, filtering etc. This grid is used to load massive of records (eg. >10000) so I set mysqldatatable.FetchAll = false to avoid fetching all records in once.
I have the following settings:
mysqldatatable.FetchAll = false
mysqldatatable.MaxRecords = 0
mysqldatatable.NonBlocking = false
mysqldatatable.QueryRecordCount = true
mysqldatatable.StartRecord = 0
grid.DataSoruce = mysqldatatable
During the initialization in runtime, I set mysqldatable.Active = true so the grid shows the first "page" of records. Meanwhile, I check the process in MySQL using SHOW FULL PROCESSLIST and I have the followings
+------+----------------+----------------------------------------------------+
| Time | State | Info |
+------+----------------+----------------------------------------------------+
| 10 | Writing to net | SELECT * FROM COMMUNICATE LIMIT 10000 |
+------+----------------+----------------------------------------------------+
If the client side does not do any action in which fetching all records is needed (such as sorting, filter), the 'Time' in MySQL keeps increasing until 8x or 9x (which is not a constant value) and the connection is killed suddenly. I tried to catch the change of connection state by MySqlConnection.StateChange but having no luck. Therefore, as the client try to access the non-fetched records, a MySqlException is thrown wtih error message "Lost connection to MySQL server during query"
On the other hand, if the client fetches all records (eg. by sorting) before the connection is killed, the connection is slept after fetching all.
Somehow, it is weird that the connection is killed without notify the client and I even don't understand why the connection is killed in this way.
Source code can be provided by request. Thanks
Joanne
I have an advanced grid in which client is able to do sorting, filtering etc. This grid is used to load massive of records (eg. >10000) so I set mysqldatatable.FetchAll = false to avoid fetching all records in once.
I have the following settings:
mysqldatatable.FetchAll = false
mysqldatatable.MaxRecords = 0
mysqldatatable.NonBlocking = false
mysqldatatable.QueryRecordCount = true
mysqldatatable.StartRecord = 0
grid.DataSoruce = mysqldatatable
During the initialization in runtime, I set mysqldatable.Active = true so the grid shows the first "page" of records. Meanwhile, I check the process in MySQL using SHOW FULL PROCESSLIST and I have the followings
+------+----------------+----------------------------------------------------+
| Time | State | Info |
+------+----------------+----------------------------------------------------+
| 10 | Writing to net | SELECT * FROM COMMUNICATE LIMIT 10000 |
+------+----------------+----------------------------------------------------+
If the client side does not do any action in which fetching all records is needed (such as sorting, filter), the 'Time' in MySQL keeps increasing until 8x or 9x (which is not a constant value) and the connection is killed suddenly. I tried to catch the change of connection state by MySqlConnection.StateChange but having no luck. Therefore, as the client try to access the non-fetched records, a MySqlException is thrown wtih error message "Lost connection to MySQL server during query"
On the other hand, if the client fetches all records (eg. by sorting) before the connection is killed, the connection is slept after fetching all.
Somehow, it is weird that the connection is killed without notify the client and I even don't understand why the connection is killed in this way.
Source code can be provided by request. Thanks
Joanne