I have a SQL statement that I expect will return one row, because I am passing the primary key. So my choices are to
I read somewhere the cathing an EmptyResultDataAccessException, since it extends runtime exception, is a bad practice.
But I can't see anything wrong with it.
I would be interested in hearing opinions
I think it's perfectly acceptable to catch that exception. It's the only Spring exception I catch that I can recall, but I have valid use cases for trying to find a record that is potentially not in existence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With