Page 1 of 1
Lost Connection During Query
Posted: Wed 26 Sep 2007 11:09
by vkamadan
Hi,
I'm working on MyDAC 4.40.0.25 with MySQL 5.0 and MySQL 4.0.18,
My problem is,
Code: Select all
//My system date set is 26.09.2007
myQuery.Open;
//successfully
//My system date set is 27.09.2007
myQuery.Close;
myQuery.Open;
//raise exception Lost Connection During Query
What's wrong?
Solution please.
Best Regards.
Posted: Thu 27 Sep 2007 07:33
by Antaeus
Please specify the following information:
- do you use the FetchAll=False mode?
- does the problem appear if you run your application out of debugger control?
- does the problem appear when you open the query second time, or when you close the first query?
- does your query contain BLOB fields?
- how much data do your queries return?
Posted: Thu 27 Sep 2007 08:08
by vkamadan
Antaeus wrote:Please specify the following information:
- do you use the FetchAll=False mode?
- does the problem appear if you run your application out of debugger control?
- does the problem appear when you open the query second time, or when you close the first query?
- does your query contain BLOB fields?
- how much data do your queries return?
Hi,
I'm test project is very simple , my form include just, 1 TMyConnection, 1 TMyQuery , 1 TDataSource and 1 TDbGrid objects, my test table include just 1 row data.
Please try a following step,
1. Application run,
2.Query Open
3.System date set a tomorrow (Application must be is already run)
4.Query Close
5.Query open , Raise Exception
But ,
1. Application run,
2.Query Open
3.System date set a tomorrow (Application must be is already run)
4.MyCOnneciton.Disconnect
5.MyCOnneciton.Connect;
6.Query open , successfuly executed my query
but, it is not a solution for me, this is not enough.
Thank's for feedback ,my best regards.
Posted: Thu 27 Sep 2007 08:31
by vkamadan
Posted: Thu 27 Sep 2007 10:25
by Antaeus
Thank you for such detailed description of the problem.
This is not an issue of MyDAC. This depends on settings of your server, specifically on the
interactive_timeout parameter. It is measures in seconds. MySQL closes connections which are inactive more than the interval specified in this parameter.
Try to restart your MySQL setting this parameter to a greater value. The maximum possible value is 31536000, which equals to one year.
You can set value of this parameter in the configuration file of MySQL (my.ini), or in the command line:
Code: Select all
%MySQL_inst_dir%\mysqld.exe --interactive_timeout=31536000
Posted: Thu 27 Sep 2007 10:58
by vkamadan
Thank's for urgently feedback,
I'm add follawing parametres in my.ini solve my problem
interactive_timeout = 31536000
wait_timeout = 31536000
net_read_timeout = 31536000
net_write_timeout = 31536000
slave_net_timeout = 31536000
Thank you for your offer a solution.
Foot note;
but at the some time, without new parameters, issueless ODBC based database access.this exception raise is just mydac direct connection metod.
My best regards.
My My.ini for all
Posted: Thu 27 Sep 2007 11:54
by eduardosic
vkamadan wrote:Thank's for urgently feedback,
I'm add follawing parametres in my.ini solve my problem
interactive_timeout = 31536000
wait_timeout = 31536000
net_read_timeout = 31536000
net_write_timeout = 31536000
slave_net_timeout = 31536000
Thank you for your offer a solution.
Foot note;
but at the some time, without new parameters, issueless ODBC based database access.this exception raise is just mydac direct connection metod.
My best regards.
my my.ini file for all...
Code: Select all
[client]
port = 3306
[mysqld]
port = 3306
connect_timeout = 31536000
interactive_timeout = 31536000
wait_timeout = 31536000
net_read_timeout = 31536000
net_write_timeout = 31536000
slave_net_timeout = 31536000
max_connections = 31536000
max_user_connections = 31536000
basedir = "F:/mySQL/"
datadir = "F:/mySQL/Data/"
language = "F:/mySQL/share/portuguese"
default-character-set = latin1
default-storage-engine = INNODB
server-id = 1
tmpdir = C:/Temp
max_allowed_packet = 16M
#Influencia no uso da memória virtual
key_buffer_size = 64M
# INNODB
innodb_data_file_path = ibdata1:2000M:autoextend
innodb_data_home_dir = "F:/mySQL/InnoDB"
innodb_log_group_home_dir = "F:/MySQL/InnoDB"
innodb_log_arch_dir = "F:/MySQL/InnoDB"
#Influencia no uso da memória virtual
innodb_buffer_pool_size = 512M
#Influencia no uso da memória virtual
innodb_additional_mem_pool_size = 16M
#Influencia no uso da memória virtual
innodb_log_buffer_size = 64M
innodb_log_file_size = 64M
innodb_lock_wait_timeout = 50
innodb_flush_log_at_trx_commit = 1
innodb_file_io_threads = 4
Posted: Thu 27 Sep 2007 12:05
by Antaeus
Such exception may be raised in many other cases.
We introduced support for handling such situations in MyDAC 5 (Local Failover and Disconnected Model features). You can consider upgrading to MyDAC 5 if this is important for you.
MyDac 5 is the best solution
Posted: Thu 27 Sep 2007 12:12
by eduardosic
Antaeus wrote:Such exception may be raised in many other cases.
We introduced support for handling such situations in MyDAC 5 (Local Failover and Disconnected Model features). You can consider upgrading to MyDAC 5 if this is important for you.
Hi, Antaeus is rigth, after the MyDAC 5 never more I had problems, mainly in access it saw unstable Internet and nets.
localfailover, Disconnected Model and Pooling, very very good.
Posted: Thu 27 Sep 2007 12:25
by vkamadan
@eduardosic ,thank's for support.
My best regards.