I want to update the data using spring--hibernate. but iam getting error saying
[2008-22-26 03:22]DEBUG[http-80-Processor24](NewPooledConnection.java:363) - com.mchange.v2.c3p0.impl.NewPooledConnection@10da1d8 handling a throwable.
java.sql.BatchUpdateException: Duplicate entry 'ff8080811b775f70011b776d270b0001' for key 2
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
[2008-22-26 03:22]DEBUG[http-80-Processor24](SqlUtils.java:85) - Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: 23000; errorCode: 1062]
java.sql.BatchUpdateException: Duplicate entry 'ff8080811b775f70011b776d270b0001' for key 2
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
[2008-22-26 03:22]DEBUG[http-80-Processor24](DefaultConnectionTester.java:126) - Testing a Connection in response to an Exception:
java.sql.BatchUpdateException: Duplicate entry 'ff8080811b775f70011b776d270b0001' for key 2
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
[2008-22-26 03:22]DEBUG[http-80-Processor24](JDBCExceptionReporter.java:63) - Could not execute JDBC batch update [insert into TDesiredPosition (authorizedToWork, employmentStatus, roles, jobTitle, desiredJobType, desiredLocation, relocate, desiredSalary_lacs, desiredSalary_thousands, usWorkStatus, user_id, notice_period, desiredId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
java.sql.BatchUpdateException: Duplicate entry 'ff8080811b775f70011b776d270b0001' for key 2
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
I know that the existing record is same but i want to update the same record with particular fields that got changed. how to write the xdoclets in hibernate for updating the existing record.
|