On Nov 19, 2007, at 6:22 AM, Anton V. Belyaev wrote:
> >>> > Setting the relation to be lazy="dynamic" really eliminated > unnecessary selects when creating Mark. Making a default relation a > bit "dynamic" is a great idea! > > There is problem when relation is both lazy="dynamic" and > cascade="all, delete-orphan": > When parent (Subject or Student) object is deleted, its children > (Marks) are not deleted. When relation is not "dynamic", children are > deleted correctly. > > Is this a proper behavior? > > Thanks for the attention. > yes, this is the caveat of the "dynamic" relation; on the "read" side, all its doing is issuing a query to the database. Therefore, any data which hasn't been flushed will not show up at that end. For this reason, the "dynamic" relation was intended to produce a smoother experience in conjunction with a session that is autoflush=True, so that whenever you read from the relation, a flush occurs first and you get the latest state back from the database. So you can see that the new behavior ive proposed in trac would produce more specifically the behavior you're looking for in this case. I hope you can wait for it ! - mike --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
