You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of assuming one global transaction ID, track knex transaction
IDs with Aurora Data API transaction IDs so multiple transactions can
occur in parallel.
Copy file name to clipboardExpand all lines: transaction.js
+17-11Lines changed: 17 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ class Transaction_AuroraDataMySQL extends Transaction { // eslint-disable-line c
14
14
15
15
asyncbegin(conn){
16
16
/* istanbul ignore next */
17
-
if(conn.parameters.transactionId){
17
+
if(conn.__knexTxIdinconn.transactions){
18
18
thrownewError(
19
-
`Attempted to begin a new transaction for connection with existing transaction ${conn.parameters.transactionId}`
19
+
`Attempted to begin a new transaction for connection ${conn.__knexUid} transaction ${conn.__knexTxId}with existing Aurora Data API transaction ID ${conn.transactions[conn.__knexTxId]}`
20
20
);
21
21
}
22
22
@@ -25,49 +25,55 @@ class Transaction_AuroraDataMySQL extends Transaction { // eslint-disable-line c
25
25
.promise();
26
26
debug(`Transaction begun with id ${transactionId}`);
27
27
28
-
conn.parameters.transactionId=transactionId;
28
+
conn.transactions[conn.__knexTxId]=transactionId;
29
29
}
30
30
31
31
asynccommit(conn,value){
32
32
// When a transaction is explicitly rolled back this method is still called
33
33
// at the end of the transaction block after the transaction no longer
0 commit comments