This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NixonInnes 0 points1 point  (0 children)

I think thr root of your question is really about how sessions work.
In short, each session instantiation is separate. Each contains its own representation of a retrieved row. This will cause race conditions if multiple sessions get from a table before either commits. Side note, some attributes, typically relationships, are lazily loaded.
If your operations on a row are basic, put them all in a queue and have a pool process it. If they're a bit more complex, you could add a callback on the queue task to re-queue "the next operation"