On Wed, Apr 30, 2008 at 6:03 AM, Christoph Haas <[EMAIL PROTECTED]> wrote:
> Fellow earthicans...
>
>  I had to restart my PostgreSQL service here and noticed that Pylons doesn't
>  recover properly. Instead of reconnecting to the database through
>  SQLAlchemy I just get "internal error"s all along.

Are there tracebacks in your error log?  It would provide some clues
to know where in your app the connection fails.  The fix for your
situation depends on A) how you are serving your pylons app and B) how
you are setting up your sqlalchemy environment.  As for A, I'm
assuming you are using long-running processes with mod_python or
mod_wsgi using apache but if you could post all the details, like
which mpm worker, etc, this would help.  If you are using fast CGI
with sockets it will be different.  As for B, there are a lot of ways
to set up sqlalchemy, were you following something like this:
http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons
?  And is there anything different in your setup code?

As a quick fix, you should probably restart apache gracefully at the
same time you restart postgres, this will stop any running
threads/processes of your pylons app *unless* you are using fast CGI
sockets, in which case you'd have to also restart the process that is
controlling the socket.

>
>  Has anyone cared for a remedy to this problem? I know that SQLAlchemy
>  doesn't notice a lost database link until a query is attempted. But can
>  this perhaps be worked around? Or does anyone know about plans for
>  auto-reconnect at SQLAlchemy?
>
>  Cheers
>   Christoph
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to