They are all mysql INNODB with the same table schemas.

I modify the code to not bind the metadata and use the same metadata
object for all session attached to databases with the same table schemas.

When I need a new table object I call Table with  autoload=True, 
autoload_with=engine

This looks to be working.


Michael Bayer wrote:
> 
> On Sep 27, 2008, at 12:35 AM, Mike Bernson wrote:
> 
>> I have a number of database that have the same tables in them.
>>
>> I create a session for 1 data and do some work. This work causes
>> a number of table table object to be reflected from the database
>> and then mapped. This works fine.
>>
>> Now I Switch to another database which has the same tables. If I
>> access only table that had been mapped in first database
>> things go fine. If I try to map a new table this is where
>> problems start with it not handling the relation. The
>> mapper when compiled says the following:
>>
>> ArgumentError: Could not determine join condition between parent/ 
>> child tables on
>> relation mds_ltc_mi.stx_setup.  Specify a 'primaryjoin' expression.   
>> If this is
>> a many-to-many relation, 'secondaryjoin' is needed as well.
> 
> 
> it sounds like your second engine doesnt have foreign keys set up ?   
> (or is like, MyISAM tables where they dont reflect) ?
> 
> 
> > 

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