-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit the session between writing and deletion of RTIF #42928
Conversation
I think has continued to use the same session. Pretty sure that the difference is pre-AIP-44 we committed in between. Here's a way to explore:
Why this matters? I feel like it's better to commit explicitly so that we see it. Rather than having it done invisibly by the decorator. |
Yeah, Issuing a commit persists things into the DB, not that the session is different.
The provide session is already doing that? Or you want it removed from the RTIF write method? I feel it's a better design to have the provide_session do it than
|
It won't do it if you provide a session. So we don't necessarily have to remove the decorator, though doesn't seem a bad idea if we don't need it.
Well, reasonable minds can differ. But what motivates me is "prefer explicit over implicit". Do it as you wish, but I think when we let provide_session do the commits implicitly, it's much less obvious what's going on (and i think that's part of how we got into trouble here). Commiting explicitly makes it very clear. It also affords an opportunity to explain why we commit there. Anyway, most of this I think will be changed as part of AIP-72, so this i think is mainly academic, about us sort of just figuring out what's the best thing to do in this kind of scenario. |
4b19606
to
257def4
Compare
Rather than two commits you can also do |
If I read this correctly, we would still have the issue: https://docs.sqlalchemy.org/en/20/orm/session_basics.html#flushing. Does this mean there was a flush in the update statement when we called |
We aren't using 2.0 style though, so I think we have to call flush ourselves in 1.4/classic style |
1f9a384
to
1e3d543
Compare
791d420
to
1e3d543
Compare
Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs
1e3d543
to
b3b7c74
Compare
* FLush the session before deleting the RTIF data Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush (cherry picked from commit ced319f)
* FLush the session before deleting the RTIF data Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: #38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush (cherry picked from commit ced319f)
* Use different sessions in writing and deletion of RTIF Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush
* FLush the session before deleting the RTIF data Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: #38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush (cherry picked from commit ced319f)
* Use different sessions in writing and deletion of RTIF Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush
* Use different sessions in writing and deletion of RTIF Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush
* FLush the session before deleting the RTIF data Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: #38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush (cherry picked from commit ced319f)
* Use different sessions in writing and deletion of RTIF Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF, which we suspect caused StaleDataError. The related PR: apache#38565 This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs * fixup! Use different sessions in writing and deletion of RTIF * add test and use flush
Previously, this was how it was done, but now, a session was used for both the writing and deletion of RTIF without committing it, which we suspect caused StaleDataError. The related PR: #38565
This PR brings back the old behaviour of using different sessions for writing/deleting RTIFs
The ERROR: