Access for DB session in Celery

100 views
Skip to first unread message

Tomek Banasiak

unread,
May 30, 2012, 6:31:45 AM5/30/12
to sqlal...@googlegroups.com
Hi,

I'm using some DB operation inside my Celery tasks and i dont know which is good approach for accessing DB session in each task.
Now i store in global celery config on start a DB session:

scoped_session(sessionmaker(bind=engine))


And each task takes that class from config and makes an instance.
But maybe better would be to store directly in celery config a DB session instance ?
Reply all
Reply to author
Forward
0 new messages