Both new to mysql, and hibernate, and currently trying to implement proper error handling, but..I am unable to determine the name of the column programaticaly generating constraint violtions..any tips greatly apprecaited.
(I'm guessing the problem may in fact be with the sql creating the table??) The sql part of the exception is able to at least find the 'key index' but not the name??
Database: mysql 4.1 (windows)
Table Create SQL (using CLAY eclipse plugin):
CREATE TABLE Borrow.Account (
idAccount BIGINT NOT NULL AUTO_INCREMENT
, date_created DATETIME NOT NULL
, date_lastLogin DATETIME
, firstname VARCHAR(20) NOT NULL
, lastname VARCHAR(20) NOT NULL
, displayname VARCHAR(20) NOT NULL
, password VARCHAR(32)
, neighborhood VARCHAR(64)
, zip INT(10)
, ratingBorrower INT
, ratingLoaner INT
, email VARCHAR(200) NOT NULL
, UNIQUE UQ_Account_idaccount (idAccount)
, UNIQUE UQ_Account_DisplayName (displayname)
, UNIQUE UQ_Account_email (email)
, PRIMARY KEY (idAccount)
)TYPE=InnoDB;
Actual Hibernate Exception Dump (pruned for easy reading):
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
.....etc..and finally....
Caused by: java.sql.BatchUpdateException: Duplicate entry 'asdf' for key 3
...
...
|