Adding support for transaction savepoint
See original GitHub issuevar knex = require('knex').initialize({..});
var q1 = knex('books').insert({ name: 'Canterbury Tales' });
var q2 = knex('books').insert({ name: 'Moby Dick' });
knex.transaction(function(t) {
return q1.transacting(t).then(function(a) {
return knex.transaction(function(t2) {
return q2.transacting(t2).then(function(b) {
});
});
});
}).then(function() { console.log('fine'); process.exit(0); },
function() { console.log('problem'); process.exit(1); });
This script succeeds under normal operation on a simple books
schema. But under pool: { max: 1, min: 1 }
, it hangs.
Issue Analytics
- State:
- Created 9 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Adding support for transaction savepoint · Issue #318 - GitHub
And yes, you're right, nested transactions are Incorrect. The correct way to handle that, in postgres at least, is with SAVEPOINT , which...
Read more >Understanding SQL Server Transaction Savepoints
In this tip we cover how to use SQL Server transaction savepoints and how the impact transactions.
Read more >MySQL 8.0 Reference Manual :: 13.3.4 SAVEPOINT ...
InnoDB supports the SQL statements SAVEPOINT , ROLLBACK TO SAVEPOINT , RELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK . The SAVEPOINT...
Read more >Documentation: 15: SAVEPOINT - PostgreSQL
SAVEPOINT establishes a new savepoint within the current transaction. A savepoint is a special mark inside a transaction that allows all commands that...
Read more >Transaction Savepoints in Spring JDBC - DZone
This post will look at how you can use savepoints within Spring JDBC.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let’s close it and see if anyone yells 😃
P.S. I confirmed it on the internal maintainer chat first 😄
Yeah, I hadn’t gotten around to it yet but I’d like to add support