Allow new transaction method in postgresql (#1493)
kv-extreme-scale needs fixing, unrelated.
This commit is contained in:
parent
6bd9fca080
commit
f5de99b249
|
@ -2229,6 +2229,11 @@ DataSource.prototype.transaction = function(execute, options, cb) {
|
||||||
// retrieved again in determineOptions() in dao.js, as well as referenced
|
// retrieved again in determineOptions() in dao.js, as well as referenced
|
||||||
// in transaction.commit() and transaction.rollback() below.
|
// in transaction.commit() and transaction.rollback() below.
|
||||||
transaction.currentTransaction = tx;
|
transaction.currentTransaction = tx;
|
||||||
|
|
||||||
|
// Some connectors like Postgresql expose loobpack-connector as a property on the tx
|
||||||
|
if (!tx.observe && tx.connector) {
|
||||||
|
tx = tx.connector;
|
||||||
|
}
|
||||||
// Handle timeout and pass it on as an error.
|
// Handle timeout and pass it on as an error.
|
||||||
tx.observe('timeout', function(context, next) {
|
tx.observe('timeout', function(context, next) {
|
||||||
const err = new Error(g.f('Transaction is rolled back due to timeout'));
|
const err = new Error(g.f('Transaction is rolled back due to timeout'));
|
||||||
|
|
Loading…
Reference in New Issue