Add hook for interrupting the db connection on cancellation.