-->
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.  [ 3 posts ] 
Author Message
 Post subject: GenericJDBCException instead of ConstraintViolationException
PostPosted: Sun Jun 19, 2005 3:14 am 
Newbie

Joined: Sun Jun 19, 2005 3:02 am
Posts: 3
In hibernate 2.1.8 when Integrity constraint violation occurs I see this:
------------------
14:54:19.666 WARN!! [SocketListener0-2] net.sf.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:57) >30> SQL Error: -8, SQLState: 23000
14:54:19.676 ERROR! [SocketListener0-2] net.sf.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:58) >30> Integrity constraint violation FUSER_1 table: GR_USER in statement [delete from gr_prstatus where prstatus_id=?]
14:54:19.676 ERROR! [SocketListener0-2] net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2400) >23> Could not synchronize database state with session
------------------

And when I use hibernate 3.0.5 in the same situation I see:

---------------------
10:47:37,767 ERROR
org.hibernate.util.JDBCExceptionReporter:logExceptions:72 - failed batch
10:47:37,782 ERROR org.hibernate.event.def.AbstractFlushingEventListener:performExecutions:277 - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
---------------------

Why do I get GenericJDBCException instead of ConstraintViolationException ?
I need ConstraintViolationException to get name of the violated constraint.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 4:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
disable JDBC batch updates


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 11:15 pm 
Newbie

Joined: Sun Jun 19, 2005 3:02 am
Posts: 3
Thanks. It works.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.