Thanks for you both! After some testing I think the main problem  
really is the firewall. I'm developing my apps from two places and  
the working copy is on my laptop. When I run my server from work I'll  
get the error after shorter idle. When I'm at home, it takes really a  
half an hour or longer this error to appear.

I think I'll make "SELECT NOW()" or similar simple query to database  
on 5 minutes interval to prevent both of these errors regardless of  
what the firewall setup is.

Thanks!


Joona.


> Mysql has a idle timeout on connection. If you leave a connection idle
> for a long time (hours) then mysql will drop the connection.
>
> This is controlled by wait_timeout system variable.
>
> To find out more Google mysql wait_timeout
>
> William K. Volkman wrote:
>> On Sun, 2006-07-30 at 17:28 +0300, Joona Kulmala wrote:
>>> I'm having some problems with ActiveMapper and MySQL connection. I'm
>>> using SQLAlchemy on top of Twisted webserver. Everything works
>>> wmoothly when the site is used, but if the connection is unused for
>>> some time, the whole webserver frozes on page load and finally after
>>> some minutes it throws an exception:
>>>
>>>      OperationalError: (2006, 'MySQL server has gone away')
>>>
>>> The connection is initialized the way ActiveMapper example and tests
>>> shows. Database server is MySQL 4.1.x and local client 5.x.x and I'm
>>> using remote server.
>>>
>>> What could be wrong?
>>
>> Do you have a firewall between your web server and the MySQL
>> server?  This sounds very much like a timed out connection.
>> You might have to add a time out that once every couple
>> of minutes just does a short query to the database.
>>
>> HTH,
>> William.
>>
>>
>> --------------------------------------------------------------------- 
>> ----
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to  
>> share your
>> opinions on IT & business topics through brief surveys -- and earn  
>> cash
>> http://www.techsay.com/default.php? 
>> page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Sqlalchemy-users mailing list
>> Sqlalchemy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>






-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to