Skip to content

Instantly share code, notes, and snippets.

@xenophy
Created September 23, 2011 05:35
Show Gist options
  • Save xenophy/1236813 to your computer and use it in GitHub Desktop.
Save xenophy/1236813 to your computer and use it in GitHub Desktop.
Next JS Module Transaction Example
me.beginTrans(function() {
me.query('INSERT INTO db1 VALUES(6, 7)', function(err) {
if(err) {
me.rollback(function() {
fn();
});
} else {
me.commit(function() {
fn();
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment