On Jan 12, 2009, at 8:16 PM, [email protected] wrote:
>
>
> thx for your reply.
>
> Sometimes i got obsolete objects:
> (Pdb) id( llm_mapper.local_table.foreign_keys[0].column )
> 447124816 <-obsolete column object, but semantically ok
> (Pdb) id( mapper.local_table.c['asl_id'] )
> 448983376 <-valid column object
> (Pdb) id( llm_mapper.local_table.foreign_keys[0].column.metadata )
> 416409552
> (Pdb) id( mapper.local_table.c['asl_id'].metadata )
> 416409552
>
> My application calls Table() several times for some tables, because I
> don't have a static db-catalog.
> After a db-catalog change Table(..autoload,use_existing) is called,
> but foreign_keys uses old column objects (i think so).
> A little example:
> -table A references B
> -B is changed, Table( B, ...) is called
> -metadata containes the new B object
> -but A.foreign_keys has obsolete column objects
> -contains_column fails, because it compares object ids(?)
Once "B" is in the metadata, its in. Calling Table("B") again would
have no effect if it were already there. But yes comparisons are
done based on the hash value of the Column object itself, string names
are just incidental, so the above structure would produce erroneous
results. The API allows no public access to create the scenario above
unless you're deleting the Table object from metadata.tables.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---