-->
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.  [ 1 post ] 
Author Message
 Post subject: Finder method giving ConstraintViolationException
PostPosted: Fri Nov 17, 2006 12:26 am 
Newbie

Joined: Fri Nov 17, 2006 12:22 am
Posts: 1
Location: Bangalore, India
The scenario is like I have a page where I can create a new entity, the first time when I create the entity it works fine with a particular code which is a Unique key on the table, then I tried to create a new entity with a different code that also worked fine. But when I tried to change the code of second entity to the same as that of the first one, in my *validate method* which tries to *find* whether there any enitity with such a code, it gives the follwoing stack trace. This is happening before the save is called also if I try to refresh the page after the error occurs it works fine and gives a proper validation failed message.

Hibernate version:3.2

Full stack trace of any exception that occurs:

ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)

Name and version of the database you are using:Oracle 10g R2

The generated SQL (show_sql=true):

2006-11-16 16:15:20,660 [SQL] [181-Processor24] DEBUG - update prashant.POSITION set NUMBER_IN_ORG=?, POSITION_CODE=?, TITLE=?, LANGUAGE=?, COST_CODE=?, START_DATE=?, END_DATE=?, BUDGETED=?, WORK_SCHEDULE=?, JOB_CODE=?, FLSA_EXEMPT=?, SOURCE_SYS_REF_KEY=?, LOCATION=?, CUSTOM_FIELD_VALUE_ID=?, ORGANIZATION_ID=?, EEO_CATEGORY_ID=?, SALARY_GRADE_ID=?, POSITION_TYPE_ID=?, JOB_FAMILY_ID=?, POSITION_OPENING_TEMPLATE_ID=?, AUDIT_TRAIL_ID=? where ID=?


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

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.