Register / Login
Win a copy of
this week in the
this forum made possible by our volunteer staff, including ...
Jesper de Jong
Stephan van Hulst
Object Relational Mapping
Unique constraint error with jpa
posted 4 years ago
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
Your mother was a hamster and your father was a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
Boost this thread!
How to delete a record from a table without a primary key
Syntax error for Access Database
Not-unique unique column
OJB and Unique Keys
Why would a thread fail?