Apart from the client-side exceptions that indicate we lost connection to the server,
and the server-side exception indicating that the cursor is (no longer) known, there is
another category that allows retrying: when the cursor was killed on the server due to an
interruption of the server itself (a shutdown for example, or a lock-breaker).
While there replace the .interrupt() + break logic with a more explicit condition
that should make it easier to follow the various exception handlers.
Apart from the client-side exceptions that indicate we lost connection to the server, and the server-side exception indicating that the cursor is (no longer) known, there is another category that allows retrying: when the cursor was killed on the server due to an interruption of the server itself (a shutdown for example, or a lock-breaker).
While there replace the .interrupt() + break logic with a more explicit condition that should make it easier to follow the various exception handlers.