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
I develop a code to update the teacher table and user table at the same time. In order for both to success, I need to use transaction. However, my code keeps giving the Knex.js timeout error.
Here's the code
controller
asynccompleteTeacherAfterRegister({ request, response }: HttpContext){constteacherId=request.param('id')constpayload=awaitrequest.validateUsing(updateTeacherValidation)constteacherData={id: teacherId,
...payload,}try{constteacher=awaitthis.teacherService.completeTeacherInfo(teacherData)returnthis.responseService.successResponse(response,'Anda berhasil mendaftar',teacher,201)}catch(error){if(errorinstanceoferrors.E_ROW_NOT_FOUND){returnthis.responseService.failResponse(response,'Tidak ada guru yang ditemukan',404)}returnthis.responseService.failResponse(response,error.message)}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I develop a code to update the teacher table and user table at the same time. In order for both to success, I need to use transaction. However, my code keeps giving the Knex.js timeout error.
Here's the code
controller
service
The error I got:
Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
Is there any solution or alternative to this? Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions