This repository has been archived by the owner on Feb 27, 2022. It is now read-only.
Using DatabaseTransactions does not play well with app transactions #22
Labels
Comments
Hey @moltar! 👋 This is a known issue that is going to be fixed. const globalTrx = Database.connection('mysql')._globalTrx
const trx = globalTrx ? globalTrx : await Database.beginTransaction()
// Do your stuff....
const article = await Article.create(metadata, trx)
await article.translations().create(translation, trx)
if (!globalTrx) {
trx.commit()
} |
What about savepoints? Knex supports that and could be an easy & quick fix. |
Are there any updates on this issue? |
Nope not yet. However, if someone is interested in working on same. I can help in guiding them |
This has been fixed in the latest Lucid release, right? @thetutlage |
What if we create a trait for a DatabaseTruncate strategy? |
Thnx for the workaround, I was wondering why transactions where not cleaning up the database after each test. This explains it. |
aldinp16
added a commit
to aldinp16/backend-table-service
that referenced
this issue
Apr 10, 2019
7 tasks
thetutlage
added
Priority: High
Semver: Alpha
Status: In Progress
Type: Bug
and removed
👨💻 PR Needed
labels
Nov 5, 2019
Hey guys! Do we have a solution to this problem? |
@luisguilhermemsalmeida apparently no changes so far |
Has this been fixed? (for adonis v4.1) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Test:
App code (
App/Facades/userFacade.js
):The text was updated successfully, but these errors were encountered: