[sqlalchemy] Re: 2 questions

2007-11-13 Thread svilen
clarification for this below; i have non-ORM updates happening inside ORM transaction (in after_insert() etc). How to make them use the parent transaction? i have a connection there. and, why atomic updates also have with commit after them? or is this sqlite-specific? every CRUD

[sqlalchemy] Re: 2 questions

2007-11-13 Thread Rick Morrison
i have non-ORM updates happening inside ORM transaction (in after_insert() etc). How to make them use the parent transaction? i have a connection there. You can pass in the Session and use Session.execute() to reuse the session connection. --~--~-~--~~~---~--~~

[sqlalchemy] Re: 2 questions

2007-11-13 Thread Rick Morrison
in the after_*() there are (mapper, connection, instance) arguments - but there's no session. Any way to get to that? mapext.get_session() does not look like one http://www.sqlalchemy.org/docs/04/sqlalchemy_orm.html#docstrings_sqlalchemy.orm_modfunc_object_session

[sqlalchemy] Re: 2 questions

2007-11-13 Thread svilen
On Monday 12 November 2007 23:11:25 Michael Bayer wrote: On Nov 12, 2007, at 2:07 PM, [EMAIL PROTECTED] wrote: hi 1st one: i am saving some object; the mapperExtension of the object fires additional atomic updates of other things elsewhere (aggregator). These things has to be

[sqlalchemy] Re: 2 questions

2007-11-13 Thread Michael Bayer
On Nov 13, 2007, at 2:00 PM, svilen wrote: i'm not sure if i am doing proper thing at all. Something like i need intermediate flush() to get B in the database first; then the insert of A will update that B and expire it eventualy. i.e. i need to have the B record in the DB in order to

[sqlalchemy] Re: 2 questions

2007-11-12 Thread Michael Bayer
On Nov 12, 2007, at 2:07 PM, [EMAIL PROTECTED] wrote: hi 1st one: i am saving some object; the mapperExtension of the object fires additional atomic updates of other things elsewhere (aggregator). These things has to be expired/refreshed... if i only knew them. For certain cases, the

[sqlalchemy] Re: 2 questions

2007-11-12 Thread sdobrev
hi 1st one: i am saving some object; the mapperExtension of the object fires additional atomic updates of other things elsewhere (aggregator). These things has to be expired/refreshed... if i only knew them. For certain cases, the object knows exactly which are these target things. How