Support PreferRepeatableRead on explicit transactions by retrying - #616
Conversation
063c985 to
22a6fed
Compare
22a6fed to
95cb8a6
Compare
scotttrinh
left a comment
There was a problem hiding this comment.
Makes sense to me, and matches what Yury and I did in the JS (minus the caching). 👍
|
I don't think we should implement the cache. Anyone who inherits from our client will have a broken caching. Like this is what Credal is doing with gel-js. |
I don't fully follow? I did put an escape hatch in the cache for dealing with cases where the client always has an extra wrapper function, or similar. We can also tweak the cache behavior so that it doesn't always default to serializable forever once it has been needed once; we could flip the state back. |
Yeah, I saw that and the explaining comment, I'm just really on the fence here thinking, hey -- it's way too much magic, and then I'm flipping back thinking -- hey, it can save a bunch of roundtrips and should be done. Anyway, let's go with the cache, let's do it. Approving the PR. |
Changes ======= * Enable reflecting of `ext` types. (by @vpetrovykh in 80a6b52) * Enable multiple modules for SQLModel reflection. (by @vpetrovykh in 8a7fdb5) * Update SQLModel generator. (by @vpetrovykh in 1d1c937) * Fix an issue with generating SQLModel with array props. (by @vpetrovykh in 2acffba) * Add encode and decode for array of array. (by @dnwpark in cc10463 for #594) * Improve nested array test skipping (by @elprans in 4dd19cb) * Fix server binary detection in WSL (by @elprans in 0d60662 for #601) * Drop Python 3.8 support (by @elprans in 1209adc for #600) * Fix reused SSLContext ALPN bug (by @fantix in 8874060 for #602) * Pin Django to ~5.1 (by @msullivan in dff941e for #610) * Make IsolationLevel enum values match the server names (by @msullivan in 7d2a401 for #611) * Make TransactionOptions default to optional (by @msullivan in 553e3ce for #612) * Implement PreferRepeatableRead, apply TransactionOptions to config state (by @msullivan in 46dae11 for #609) * Support PreferRepeatableRead on explicit transactions by retrying (by @msullivan in e1e25c0 for #616) * Make EnumValue support comparison to strings (by @msullivan in bb93ed7 for #615) * Update AI RAG response parsing. (by @dnwpark in 9060b04 for #618)
The method for detecting the need to retry is kind of hacky.
We cache using the filename and line number of the caller.