Use SQL transactions with node-mysql
npm install mysql
npm install mysql-transactions
var transactions =user: 'hamburglar'password: 'omnomnomnomnomnom'database: 'playhouse';transactions;transactions;
Note: After calling
.rollback() must be called so that the
connection is closed.
[fn] is a
callback for a mysql.query.
begin([fn]): start the transaction process.
query(String [, Object/Array] [, fn]): traditional query.
rollback([fn]): rollback the transaction.
commit([fn]): commit the transaction.