Thanks Michael,

I should have read the docs a bit more carefully.

I have one more question which is sort of related (but has more to do 
with 0.1 -> 0.2 migration)

In 0.1, I used the following idiom:

engine.begin()
try:
 engine.commit()
except:
 engine.rollback()

is the equivalent in 0.2, using the SessionContext plugin you showed:

trans = ctx.create_transaction()
try:
 trans.commit()
except:
 trans.rollback()

Thanks

Huy
> yeah use the sessioncontext extension module.
>
> http://www.sqlalchemy.org/docs/plugins.myt#plugins_sessioncontext
>
>
> import sqlalchemy
> from sqlalchemy.ext.sessioncontext import SessionContext
>
> ctx = SessionContext(sqlalchemy.create_session)
>
> obj = MyObject()
>
> ctx.current.save(obj)
>
> ctx.current.flush()
>
>
> On Jun 13, 2006, at 6:47 AM, HD Mail wrote:
>
>   
>> Hi,
>>
>> Is it possible to get the functionality of the threadlocal plugin (i.e
>> objectstore/default thread local session), but not have all my mapped
>> classes automatically added to the objectstore when i instantiate  
>> them ?
>>
>> I am willing to call "save" on objects I want to save.
>>
>> Many Thanks,
>>
>> Huy
>>
>>
>> _______________________________________________
>> Sqlalchemy-users mailing list
>> Sqlalchemy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>>     
>
>
>
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>   



_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to