Ubestim wrote:
>
> The mysql has gone away thing:
>         mysql server timeout:60 (1 min)
> I read the source code of SA , and figure out the following
> solutions :
>         sl1 --> set pool_size=1 and max_overflow #this will close all
> connections in pool,because the
>                                           only conn is closed by my
> app with (session.close(),connection.close(),
>                                             or result.close()
>                                         and all overflow conn are
> closed and discarded when recycling to pool
>
>                             this solution doesn't work)
>         sl2 --> set pool_recycle = 50  #recycle conn before mysql
> timeout 50-60=10 10s for recycle is needed
>         sl3 --> set poolclass=NullPool      #don't use pool strategy
>         sl4 --> add poollistener
>         sl5 --> set pool_recycle=1 or 0 # ensure to reclye and create
> new conn when check out at any time
> after try all these 5 solutions ,the mysql has gone away problem is
> still there !!!

what might be the reason that MySQL is not listening for connections ? 
Are you trying to recover from restarts ?    For a total non-persistent
connection approach, use the NullPool and always close your Session, that
way no connections will be opened at all when you aren't in the middle of
an operation.   The NullPool is basically not a pool at all.

Also, its true that any Connection objects you have lying around will
still be active, so make sure you aren't doing that.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to