File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 46375
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: 15092

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!