Hi,

I have a web application with servlets and jsp's. I use a connection pool to
optimize connections to database.
Usualy all works fine but sometimes, after a period of inactivity (30-50
minutes), connections are lossed. This only occurs if mysql and web server
are in different machines.
In MySql Control Center I can see connections but my application seems not
to see them.

Every time the application needs a connection, the system ask for one to the
pool.
The pool searchs for a free connection and checks it with a kind of ping
"select curdate()" before assigning it to the application. This prevents the
use of "timeouted" connections.
The problem is that sometimes, this ping doesnt't responde for a long time,
until 13'.
I've tried to adjust the connectTimeout of jdbc driver but nothing changes.
If I adjust the jdbd driver parameter socketTimeout to 2 seconds, after 2
seconds the ping returns fail and I try to create a new connection with
success.
This is working fine but this parameter affects to all operations against
db, that's to say, if the user ask for a long query, after 2 seconds the
system cuts the connection.

Any ideas to prevent this looses without cutting long queries?

        Thanks in advance

        Begoņa Villamor


Environment: Apache 2.0.46, Tomcat 4.1.30, mod_jk 1.2.5, MySql 4.0.20, mysql
jdbc driver 3.0.7 , jdk 1.4.2_05
Driver properties are:
        autoReconnect: false  (No difference with this property true)
        maxReconnects: 3, initialTimeout: 2
        socketTimeout: 2000, interactiveClient: false
        useCompression: false,  connectTimeout: 0 (No difference with this property
2000)
Server variables:
        'connect_timeout','5', 'delayed_insert_limit','100',
'delayed_insert_timeout','300'
        'delayed_queue_size','1000', 'interactive_timeout','28800',
'long_query_time','10'
        'max_connect_errors','10', 'max_connections','100',
'max_delayed_threads','20'
        'max_insert_delayed_threads','20', 'max_user_connections','0',
'net_read_timeout','30'
        'net_retry_count','10', 'net_write_timeout','60', 'skip_networking','OFF'
        'slave_net_timeout','3600', 'wait_timeout','28800'


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to