node-orm-transaction: is it possible to perform transactions in one mysql
connection for all clients?
Currently i connect to the db only once, when i start my node application,
just after that i load all my models and after that my app is ready to
handle any requests via socket.io rpc.
I need to achieve the logic - that if client performs complex request, and
if at least one operation failed in chain - for example - all sql requests
were done successfully, but email with new password was not sent -
rollback everything and show error.
I'm asking, because I remember - in php for example all processes have
different connections to db, that's why all transations are independent
and can't cross, but for node it's just one process with async requests,
that in theory can cross. It's just my first app on node.js.
Is it possible to make with 1 mysql connection for all clients, or i need
to connect to mysql, retrieve all models from remote file in each request
in socket.io?
No comments:
Post a Comment