A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
Unique constraint error with jpa
Joined: Sep 07, 2011
Mar 20, 2012 06:42:04
I am currently stuck with this problem and I hope someone can assist.
My db is in SQL Server. I have certain uniqueness constraints on my tables.
When the entity manager persists it returns correctly the exception
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'UN_PERSONTBL_PASSP'. Cannot insert duplicate key in object 'dbo.PERSONTBL'.
Now I need a user friendly error message but I ca;t find a way to automate this other than doing
subject: Unique constraint error with jpa
How to delete a record from a table without a primary key
Why would a thread fail?
Syntax error for Access Database
OJB and Unique Keys
Not-unique unique column
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013