your classes and mappers should be created at the module level, so  
that once a module is imported, the mapper for that class is created  
just once along with the class itself.

On Mar 6, 2009, at 7:42 AM, Marcin Krol wrote:

>
> Hello everyone,
>
> *From time to time* I get the following exception in my web app  
> deployed
> using mod_python:
>
> ArgumentError: Class '<class
> '_mp_275338c85bf6e509c22a44d1e08ba3fd.Architecture'>' already has a
> primary mapper defined. Use non_primary=True to create a non primary
> Mapper.  clear_mappers() will remove *all* current mappers from all  
> classes.
>
> If I use sqlalchemy.orm.clear_mappers(), the problem goes away -
> however, it bugs me to see some evidence that mappers and possibly  
> some
> other state is retained between http requests in mod_python. Does
> anybody know why / can it be harmful in some other way?
>
> Regards,
> Marcin Krol
>
>
>
> >


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

Reply via email to