Transactions with lb4 and mysql

I have a backend with loopback 4 and a database in mysql, I am handling transactions exactly as the official documentation indicates, the problem is that when the transaction fails for any reason, the id that is autoincrementable in the database is lost and automatically when another transaction is registered and it is successful the id has no sequence, that is to say, in a few words, I generate ghost records in the database.

My model

My repository

My controller

DB

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.