Thanks Mike for all the explanations.
On Mon, Sep 28, 2009 at 7:54 AM, Michael Bayer <mike...@zzzcomputing.com> wrote: > > nkhalasi wrote: >> >> However with this I am getting unwanted commits. Essentially when the >> newid(ctx) function executes the update it also does an commit which >> results into my data committed which I would have otherwise expected >> to be committed at some other point. I am trying to figure out how can >> this update of next ID be done along with my regular application logic >> commit. > > if you are doing something like engine.execute(statement), you'd need to > use a transaction. i.e. conn = engine.connect(); trans = conn.begin(); > conn.execute(statement); trans.commit(). > > if you were executing the INSERT via the ORM (i.e. Session.commit()) the > connection you receive is within a transaction and no autocommit will > occur. > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---