I am using spring with hibernate and when I am trying to insert a data which already exists, it throws DataIntegrityViolationException. So to handle this exception I have placed a try/catch block in my save method in DAO layer, but it's not getting caught. After that I placed a try/catch block in save method of service layer also but there also its not getting caught.
I have a testMain method in my service layer and when I am handling there its getting caught there.
Please help how to handle this in my DAO layer
Aucun commentaire:
Enregistrer un commentaire