-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: DataIntegrityViolation caused by constr that doesn't exist
PostPosted: Mon Feb 16, 2015 10:14 am 
Newbie

Joined: Mon Feb 16, 2015 6:57 am
Posts: 2
Hi all! I'm new for this forum and perhaps can make some mistakes. But I hope that I will not.

I use Hibernate 3.6.9.Final and Oracle as underlying storage.

I got the next:

Code:
org.springframework.dao.DataIntegrityViolationException: could not insert:[ru.at_consulting.ruz.db.entities.User]

....
Code:
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [ru.at_consulting.ruz.db.entities.User]

And finally:
Code:
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (GM.RUZ_SEC_USER_U1) violated.


The method retrieves users list from DB, after that checks theirs logins with new incoming users list, and then saves diffrence between the first and the second lists, more precisely will be saved users from incoming list which has not been stored in DB. I understand that it violation was caused in saveOrUpdate method during refresh process.

But what actually is unclear? - this constraint [RUZ_SEC_USER_U1] doesn't exist in DB!
In DB schema any constraint with this name does not exist at all (I've already checked it by ALL_CONSTRAINTS and DBA_CONSTRAINTS).

Somebody has seen such exception before? Can it be a hibernate problem?


Top
 Profile  
 
 Post subject: Re: DataIntegrityViolation caused by constr that doesn't exist
PostPosted: Mon Feb 16, 2015 3:22 pm 
Newbie

Joined: Mon Feb 16, 2015 6:57 am
Posts: 2
Problem solved.

It actually an index on login field.

There was two different users with identical logins and they was causing this error.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.