[Adonis v4] Transactions Problem on SQLite #1720
-
Hi, i got some problem when try to create database transaction in adonis v4. In development and production this code is worked. When i try to run functional test entire database transaction is fail.
I don't think is testing tool problem, when i try to change database config to sqlite that problem is still exists. Am i missing something ?. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This following call is not using the transaction. await Custom.create({
transaksi_detail: detail.id,
name: req.name,
}); Also the following call should be using the transaction client as well const transaksi = await Transaksi.findOrFail(id); Remember SQLite has only one connection and that is blocked in the case you create a transaction and hence all queries have to use the transaction object. |
Beta Was this translation helpful? Give feedback.
This following call is not using the transaction.
Also the following call should be using the transaction client as well
Remember SQLite has only one connection and that is blocked in the case you create a transaction and hence all queries have to use the transaction object.