Reworked persistence exception handling.