Comment gérer JPA violations de contrainte unique?

Lorsqu'une unique contrainte est violée, une javax.persistence.RollbackException est levée. Mais il pourrait y avoir plusieurs raisons à jeter un RollbackException. Comment puis-je savoir qu'une contrainte unique a été violé?

try {
    repository.save(article);
}
catch(javax.persistence.RollbackException e) {
    //how to find out the reason for the rollback exception?
}
InformationsquelleAutor deamon | 2010-08-17