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

Make it clear in the README that calling db.Save, db.Update, etc. by themselves is thread-safe #266

Open
novemberisms opened this issue Apr 1, 2020 · 0 comments

Comments

@novemberisms
Copy link

Hi,

As someone looking at storm coming from Bolt, it's not at all written in the README that the methods on DB or Node like Save, Update, One, or All, can be called by themselves outside of a bolt.DB.View, bolt.DB.Update, or bolt.DB.Batch closure.

In vanilla bolt, practically all transactions must be done within one of those methods to ensure thread-safety.

Therefore most users coming from bolt with wrap all their storm.DB methods in a bolt transaction. This might be fine, but they should be made aware from the start that they don't need to because it is threadsafe by default.

The only way I was able to figure this out was to dig into the storm source code and see that indeed, db.Save, db.Update, etc. do internally use bolt.DB.Update and bolt.DB.View even if you don't call them from a transaction. This is not ideal.

Someone already had this question in the past (#199). And I'm sure me and many others did too. To prevent more people asking the same question, I suggest making it clear or having a section in the README that this is the case.

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