【发布时间】:2010-08-17 12:18:35
【问题描述】:
当违反唯一约束时,会抛出javax.persistence.RollbackException。但是可能有多种原因要抛出RollbackException。如何发现违反了唯一约束?
try {
repository.save(article);
}
catch(javax.persistence.RollbackException e) {
// how to find out the reason for the rollback exception?
}
【问题讨论】:
标签: java exception jpa exception-handling constraints