Re: [sqlalchemy] Mysql server has gone away

2014-01-13 Thread Srini K
One way I resolved this is, periodic dummy query 'select 1' to make sure connection is held. Using Tornado, I do something like following in my models. class Db(object): def __init__(self): engine_string = 'mysql'+'://'+options.mysql_user+':'+options.mysql_password+'@

[sqlalchemy] Re: Multiple sessions

2013-06-28 Thread Srini
Just to close my question: I tweaked few settings for innodb and seems pretty good already. The biggest is being: transaction_isolation = READ-COMMITTED Of course not for everyone but for my needs, this works perfectly. thanks On Thursday, June 27, 2013 8:36:51 PM UTC-7, Srini wrote: I

[sqlalchemy] Multiple sessions

2013-06-27 Thread Srini
Hi, I am using tornado, sqlalchemy behind ngnix in reverse proxy mode. I run 4+ app servers and each maintaining it's own db session and connection. I am seeing the same problem as mentioned in the forum. One session creates new data and other session doesn't get updated information. As I am

[sqlalchemy] Re: Multiple sessions

2013-06-27 Thread Srini
I guess my question should have been how do I handle consistent non locking reads as app server is reverse proxied and each request goes to different session. thanks On Thursday, June 27, 2013 8:11:38 PM UTC-7, Srini wrote: Hi, I am using tornado, sqlalchemy behind ngnix in reverse proxy