exception handling for some db scenarios