Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

[QUESTION] Deal with large queries/transactions #2

Closed
AdriVanHoudt opened this issue Jan 26, 2015 · 0 comments
Closed

[QUESTION] Deal with large queries/transactions #2

AdriVanHoudt opened this issue Jan 26, 2015 · 0 comments

Comments

@AdriVanHoudt
Copy link

I'm currently also using the node-mysql lib in combination with Hapi. I like the way you wrote wrapper to handle the connection on every query. My question is, how would you deal with transactions? There are operations that require multiple inserts and if one of them fails I need to be able to rollback to prevent corrupt data. Although you can add some functionality to handle transactions on every query I don't see how you could handle transactions over multiple queries with your example and I would very much like to see how you would solve it. Since you are clearly more advanced at it than me. For reference I wrote https://github.com/Salesflare/hapi-plugin-mysql to deal with the connections. I basicly handle them per request. But this causes me to use the same connection for auth and such and I always have to use a transaction.
Any help is appreciated!

@AdriVanHoudt AdriVanHoudt changed the title [QUESTION] Deal with large queries [QUESTION] Deal with large queries/transactions Jan 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant