Hello,
My question is regarding long-running tasks and db sessions. Currently I have the very rare situation where a task takes longer than a db session is valid and thus fails when it wants to write back results. Extending the TTL of a db session is probably not a good idea.
I think the proper approach would be to open a db session, fetch data, close the db session, do work, open a new db session, write data, close the db session. So, I must make sure that I fetch all data ahead of time while the first session is active.
Is there a way to re-associate objects that belonged to the first session with a newly opened one? What’s the recommended approach here, does SQLA have any magic in store to help me with very long-lived ORM objects across db sessions? Or should I manage that data independently of their respective ORM objects?
Thanks!
Jens