Skip to content
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

Atomic update #1

Open
vadzimrudkouski opened this issue Jan 24, 2019 · 0 comments
Open

Atomic update #1

vadzimrudkouski opened this issue Jan 24, 2019 · 0 comments

Comments

@vadzimrudkouski
Copy link

In the current implementation there is no such thing as update. It could be imitated through combination of Contains, Delete and Put.

            using (ICryptoStorage storage = _factory.Create(Path))
            {
                if (storage.Contains(key))
                {
                    storage.Delete(key);
                }

                storage.AddString(key, data.ToJson());
            }

The problem is that this code is not running inside the transaction. There are possible ways exist when key is successfully deleted but not added and to way to rollback delete functionality.

Atomic update should be added as a part of ICryptoStorage API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant