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

Export db.Begin function #16

Closed
sergeyt opened this issue Oct 29, 2016 · 5 comments
Closed

Export db.Begin function #16

sergeyt opened this issue Oct 29, 2016 · 5 comments

Comments

@sergeyt
Copy link

sergeyt commented Oct 29, 2016

This one easy to do and allows controlling transaction inside application.

@tidwall
Copy link
Owner

tidwall commented Nov 9, 2016

Hi @sergeyt, Sorry about the delayed response.

I chose not to include export db.Begin and db.Commit/Rollback in favor of using the managed functions db.Update/View. Using the managed functions minimize risk of deadlocks and I didn't see an advantage with exporting. But maybe I'm overlooking something.

@sergeyt
Copy link
Author

sergeyt commented Nov 27, 2016

Hi @tidwall, I agree that the use case to use db.Begin directly is uncommon. But it might be used in the library like my nosql where the underlying storage is abstracted over unified interface. Initially I've wrapped boltdb that has explicit db.Begin function. Anyway I think it is still feasible to implement nosql interface over BuntDB API.

@sergeyt
Copy link
Author

sergeyt commented Nov 27, 2016

upper.io also has Tx transaction interface.

@tidwall tidwall closed this as completed in 74dc101 Dec 2, 2016
@tidwall
Copy link
Owner

tidwall commented Dec 2, 2016

Hi @sergeyt,

I finally got around to exporting the those functions. Let me know if you run into any problems. Thanks for the suggestion.

@sergeyt
Copy link
Author

sergeyt commented Dec 11, 2016

Hi @tidwall. Great, thank you!

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

2 participants