On 8/09/24 11:03 pm, Jon Ribbens wrote:
On 2024-09-08, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
    try:
      do something
      .commit()
    except:
      log something
      .rollback()

What if there's an exception in your exception handler? I'd put the
rollback in the 'finally' handler, so it's always called.

Good point. Putting the rollback first would be safer/

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to