79315659

Date: 2024-12-29 13:22:30
Score: 1
Natty:
Report link

The problem is here:

F: for<'a> FnOnce(&'a mut Transaction<'b>) -> Fut,

You are indicating that the reference must stay alive at least until the closure finishes executing. However, the first query you run consumes the transaction reference that you pass. I suggest that you pass the transaction itself to the closure and make sure the closure returns it back.

You will also need to create an Err-Ok result struct that contains the transaction, so you can either commit or abort the transaction in the outer method.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: ManuelGDLVH