Created
September 23, 2011 05:35
-
-
Save xenophy/1236813 to your computer and use it in GitHub Desktop.
Next JS Module Transaction Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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