what do your Table objects look like ?  a ForeignKey() object must be
present on the "y" column of "B" in order for the unit of work to know
the proper order of operations (or the mappers must have explicit
primaryjoin/foreign_keys parameters configured).


On Nov 9, 10:42 am, Manlio Perillo <[EMAIL PROTECTED]> wrote:
> Hi.
>
> It seems that from SQLAlchemy 0.3.7(?) the unit of work, after a flush,
> executes the SQL operations in a different order.
>
> As an example, assuming this schema
>
> CREATE TABLE A (
>     x INTEGER PRIMARY KEY
> );
>
> CREATE TABLE B (
>    y INTEGER PRIMARY KEY REFERENCES A(x)
> );
>
> in 0.36 I can execute, in a session transaction:
> a = A(x=10)
> sess.save(a)
>
> b = B(x=10)
> sess.save(b)
>
> sess.flush()
>
> This no longer works on 0.3.10, where I need to do a flush after `a`
> creation.
>
> Is this a feature?
> Is it possible to force the unit of work to execute queries in the right
> order, in order to avoid an intermediate flush?
>
> Thanks  Manlio Perillo


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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