On Dec 2, 2010, at 9:23 AM, Szymon Pyżalski wrote: > Hello! > > I am currently working on a daemon that connects to the MySQL db via > SQLA. Some of the queries are done with ORM. I am trying to handle the > errors (mostly disconnection errors) by calling rollback() to the > session that caused the exception, putting the thread to sleep for some > time and then retrying the query. However sometimes when testing this by > killing and starting the db manually I don't get the desired behavior. > The daemon will keep to log the error (MySQL server has hone away) even > after the db restart. What am I doing wrong? Or where can I find some > good docs to solve my problem? I have already read > http://www.mail-archive.com/[email protected]/msg09181.html > but can't find the answer there (according to Michael calling rollback() > is good).
make sure you're on 0.6.5 as there were some bugs with the MySQL reconnect stuff in previous versions. normal behavior for reconnect is we catch the error, dump the whole connection pool, so on the next run the connection is good. MySQLdb itself recycles connections if we don't which makes it confusing (and hid the bug for awhile). > > Best regards, > Szymon > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
