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
My application accesses a database within a transaction so I need to commit/rollback the transaction and return the database connect to the pool after request processing is complete.
This comment here #29750 (reply in thread) suggests using Response.waitUntil() as a substitute for res.on('finish', callback) but I don't believe that can work since waitUntil is supplied a promise (which would start executing immediately).
I think I can also rule out NextResponse.next() since it does not return the final response, just a sentinel for the middleware executor.
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
-
My application accesses a database within a transaction so I need to commit/rollback the transaction and return the database connect to the pool after request processing is complete.
This comment here #29750 (reply in thread) suggests using
Response.waitUntil()
as a substitute forres.on('finish', callback)
but I don't believe that can work since waitUntil is supplied a promise (which would start executing immediately).I think I can also rule out NextResponse.next() since it does not return the final response, just a sentinel for the middleware executor.
Beta Was this translation helpful? Give feedback.
All reactions