8000 Make it clear in the README that calling db.Save, db.Update, etc. by themselves is thread-safe · Issue #266 · asdine/storm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Make it clear in the README that calling db.Save, db.Update, etc. by themselves is thread-safe #266
Open
@novemberisms

Description

@novemberisms

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0