question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding support for transaction savepoint

See original GitHub issue
var 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:closed
  • Created 9 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jurko-gospodneticcommented, May 19, 2016

Let’s close it and see if anyone yells 😃

P.S. I confirmed it on the internal maintainer chat first 😄

1reaction
tgriessercommented, Jun 14, 2014

Yeah, I hadn’t gotten around to it yet but I’d like to add support

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found