該組合MySQL的/休眠正在創建異常堆棧痕跡等BatchUpdateException - MySQL錯誤'Duplicate entry' - 哪個鍵/約束被違反?
Caused by: java.sql.BatchUpdateException: Duplicate entry '7872551600-B1310955127' for key 2
在com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:652) 在org.jboss.resource.adapter.jdbc.WrappedStatement .executeBatch(WrappedStatement.java:519) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 51更多
現在發生的事情很明顯。有一個表中有一個約束(唯一鍵),並且這個約束被違反了。
但是,所有的例外說明,一些關鍵'2'已被違反。有沒有辦法讓MySQL打印出哪些約束被違反?或者至少在哪張桌子上?
由於 霍爾格