[sqlalchemy] advice sought : `commit()` without expiring from the session ?

2014-07-08 Thread Jonathan Vanasco
I have a situation where I need to issue a `commit()` without expiring the object/attributes from the session. I'm in a `Celery` task, and need to log progress at certain points into a status column. the status points will be used to troubleshoot and fix jobs that didn't correctly complete.

Re: [sqlalchemy] advice sought : `commit()` without expiring from the session ?

2014-07-08 Thread Mike Bayer
you can make a new Session() with expire_on_commit=False, that can be from your sessionmaker. the settings you apply there override whats in the original factory. Though for status logging I tend to just use a separate Session/transaction for that, that way the main transaction can maintain