This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Weird ConstraintViolationException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Weird ConstraintViolationException" Watch "Weird ConstraintViolationException" New topic

Weird ConstraintViolationException

Andre Mazoni

Joined: Oct 21, 2011
Posts: 1

Hello guys,
I got a problem that is very weird.. This is the situation:
I have two classes: Code and FinancialMove. The FinancialMove has a Code (many moves to one code).
There are two codes in the db and just one of them is related to a registered FinancialMove.
If I try to remove the "unrelated" code it works, but if I try to remove the related one before it throws the exception (which is correct) then I try to remove that first one but it also says that this code is related to some financialmove.

Do you guys have any idea of what's happening?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45338
Welcome to the Ranch

You would have to supply more information; that Exception doesn’t appear to be in the standard Oracle/Sun API, so you would need to know where it is from, and its details.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15042

There's a javax.validation.ConstraintViolationException in the Java EE 6 API, is that what you meant?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Weird ConstraintViolationException
It's not a secret anymore!