Errno::EINVAL (Invalid argument)....

Hi, I got Errno::EINVAL (Invalid argument) error.. This error is occurred only when the system is inactive for more then 3hrs... I am using rails 1.2.5 with activescaffold 1.0.1 and mysql 6.0... and also using the mongrel server... Plz anyone let me know if there is any solution to this....

my stack trace looks like this....

Errno::EINVAL (Invalid argument):     c:/ruby/lib/ruby/1.8/mysql.rb:1042:in `flush'     c:/ruby/lib/ruby/1.8/mysql.rb:1042:in `write'     c:/ruby/lib/ruby/1.8/mysql.rb:462:in `write'     c:/ruby/lib/ruby/1.8/mysql.rb:436:in `command'     c:/ruby/lib/ruby/1.8/mysql.rb:307:in `stat'     c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_record/connection_adapters/mysql_adapter.rb:215:in `active?'     c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_record/connection_adapters/abstract_adapter.rb:93:in `verify!'     c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_record/connection_adapters/abstract/ connection_specification.rb: 109:in `verify_active_connections!'     c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_record/connection_adapters/abstract/ connection_specification.rb: 108:in `each_value'     c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_record/connection_adapters/abstract/ connection_specification.rb: 108:in `verify_active_connections!'     c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb: 110:in `prepare_application'     c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:39:in `dispatch'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/rails.rb:76:in `process'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/rails.rb:74:in `synchronize'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/rails.rb:74:in `process'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:159:in `process_client'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:158:in `each'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:158:in `process_client'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:285:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:285:in `initialize'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:285:in `new'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:285:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:268:in `initialize'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:268:in `new'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel.rb:268:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/configurator.rb:282:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/configurator.rb:281:in `each'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/configurator.rb:281:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/ mongrel_rails:128:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/../ lib/mongrel/command.rb:212:in `run'     c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-i386-mswin32/bin/ mongrel_rails:281     c:/ruby/bin/mongrel_rails:16:in `load'     c:/ruby/bin/mongrel_rails:16

Wild guess: MySQL is configured to drop db connections that are inactive more that tree hours. while your application thinks the connection is still open

But i have never configured any thing with mysql... What my be the solution.... In this case how to keep mysql connection tome out foe a longer time...