On Oct 8, 9:07 pm, "Dunk Fordyce" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> We've got a bit of an odd error with sqlalchemy. The situation is we're
> running the same pylons app under two subdomains each connected to a
> different database. Each app sits in its own virtualenv but is the same
> code. Each connects to a different mysql database. The first app runs fine
> and has done for some time, when we try and use the second however we're
> seeing:
>
>     InvalidRequestError: Table 'accounts' is already defined for this
> MetaData instance.  Specify 'useexisting=True' to redefine options and
> columns on an existing Table object.
>
> Im 90% sure this is an issue with mod_wsgi ( or how we have set it up) as I
> can run the second instance with paster serve without this error.
>
> Can anyone give any hints as to how to fix this or to further debug the
> problem?
> We are running mod_wsgi 2.0 in daemon mode and sqla 0.4.5.

In mod_wsgi, separate sub interpreters are used to separate WSGI
applications. Because of how Python works/is implemented, the
isolation between them isn't perfect. Two areas where there can be
problems are leakage of os.environ variables between sub interpreters
and third party C extension modules which aren't implemented to
properly work in multiple sub interpreters at the same time. Thus,
depending on how MySQL module is implemented, it could be misbehaving
in such a situation.

What you would be best off doing is use mod_wsgi daemon mode to create
separate daemon process groups to run each WSGI application (virtual
host) within. That way they run in separate processes and can't
interfere with each other.

Graham
--~--~---------~--~----~------------~-------~--~----~
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