Re: [sqlalchemy] session.execute(sql_statement) does not flush the session in a autoflush=True session ?
On Fri, 2010-11-26 at 15:41 -0500, Michael Bayer wrote: I wouldn't say its a bug since its intentional. But I'll grant the intention is up for debate. I've always considered usage of execute() to mean, you're going below the level of the ORM and would like to control the SQL interaction directly, not to mention with as minimal overhead as possible, which is why it works that way currently. It might be just as surprising to many users if execute() issued a whole series of insert/update statements as much as it was apparently surprising to you that it did not. I agree with the current behaviour. I've never actually thought of execute as doing anything other than *exactly* what I want it to do - and only that. Hi, In a session which has some dirty objects, doing session.execute(sql_statement) doesn't not flush the dirty objects to the database before executing the sql_statement query. The session was initialized with autoflush=True. Is it the expected behaviour ? Is it a bug ? Thanks -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
[sqlalchemy] session.execute(sql_statement) does not flush the session in a autoflush=True session ?
Hi, In a session which has some dirty objects, doing session.execute(sql_statement) doesn't not flush the dirty objects to the database before executing the sql_statement query. The session was initialized with autoflush=True. Is it the expected behaviour ? Is it a bug ? Thanks -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] session.execute(sql_statement) does not flush the session in a autoflush=True session ?
I wouldn't say its a bug since its intentional. But I'll grant the intention is up for debate. I've always considered usage of execute() to mean, you're going below the level of the ORM and would like to control the SQL interaction directly, not to mention with as minimal overhead as possible, which is why it works that way currently. It might be just as surprising to many users if execute() issued a whole series of insert/update statements as much as it was apparently surprising to you that it did not. On Nov 26, 2010, at 1:49 PM, Emmanuel Cazenave wrote: Hi, In a session which has some dirty objects, doing session.execute(sql_statement) doesn't not flush the dirty objects to the database before executing the sql_statement query. The session was initialized with autoflush=True. Is it the expected behaviour ? Is it a bug ? Thanks -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.