Is it possible to get a ReadTransaction from a WriteTransaction? #175
-
|
I tried looking in the docs and wasn't able to find anything but still asking here just in case I missed something. Is it possible? Both of them seem to have pretty much the same methods so it feels like it should be possible, but I don't know too much about the internals of fjall to turn this into a feature request. I have a few functions that take in transaction handles to do their work as part of a larger transaction, and right now I have to duplicate their internals both read and write transactions separately. Being able to "cast" a WriteTransaction into a ReadTransaction (or perhaps a common trait they both implement?) would help a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
TL;DR Currently no, but... If the SSI feature flag is used, a write transaction that does not write is basically the same as a read transaction. Though SSI transactions need extra retry logic. The R/W split is only really necessary when using single-writer transactions (the default). So the API will probably change in V3 go better reflect that. A Readable kind of transaction that is implemented by WriteTransaction is probably a good idea. |
Beta Was this translation helpful? Give feedback.
-
|
See #188 |
Beta Was this translation helpful? Give feedback.
See #188