Transaction
#228
Replies: 2 comments
-
Going through Sled's transactional implementation, it seems your https://docs.rs/sled/0.34.6/sled/transaction/struct.TransactionalTree.html I will look into it :) thanks |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hmmm I think this would be a nice easy work around for the current structure but inferior in the end. While it would be quite easy to implement, especially for something like Sled, I think it would be better to have operate transactions on the Glue side, if I remember to I will elaborate further tomorrow. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This kind of pseudo code below may work I think.
Introducing two transaction traits;
BeginTransaction
andEndTransaction
.Unlike other traits like
StoreMut
orAlterTable
,BeginTransaction
trait returnsStore + StoreMut + EndTransaction
rather thanSelf
.Then, in the case of
SledStorage
.. (I'll skip including the optional onesIndex
andAlterTable
)We can make
SledStorage
to implementStore
,StoreMut
andBeginTransaction
.Note that using existing
StoreMut
implementation cannot store the intermediate data for transaction rollback situation.To make this work, we can add
TransactionalSledStorage
which implementsStore
,StoreMut
andEndTransaction
.SledStorage
can only begin transaction.TransactionalSledStorage
can only rollback or commit transaction.Then, we can make
TransactionalSledStorage
stateful itself by storing the data during transaction.Beta Was this translation helpful? Give feedback.
All reactions