simplej

Results 7 comments of simplej

After failing to make your library usable I simply switched to issuing queries to start/commit/rollback transactions. It's significantly easier to manage in both existing and new code. I'm not sure...

I would always opt for wasting CPU/network time rather than developer time. The fixed or variable costs incurred by strengthening infrastructure are minuscule compared to developer time, especially if capitalized,...

Yes. Code could be written like so: ``` pool.getTransaction(function(err, trans) { async.waterfall([ function(callback) { trans.query(..., function(err, results, fields) { // processing return callback(err, ...); }); }, function(..., callback) { trans.query(...,...

Looks good. Consider though that one might want to use transactions with existing connections. I think there should also be a startTransaction() (that only executes "START TRANSACTION") on the connection...

Trying to defend against developers who don't know what they're doing opens up a can of worms. The most I would do is name the functions differently, for example pool.getTransaction()...

Your assertion that "for transactions to work, you need to create a connection pool" is clearly wrong. Transactions are SQL commands and have nothing to do with pools or any...

I understand what you're trying to do, and it's not crazy. You want to look at it sort of like a readers-writer lock, by assuming that if a connection is...