-->
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.  [ 4 posts ] 
Author Message
 Post subject: Catching exception
PostPosted: Mon Jan 14, 2008 7:08 am 
Newbie

Joined: Thu Jan 10, 2008 9:13 am
Posts: 4
Hibernate version:3.2

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

I am trying to catch exception
Code:
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

and od something in my code. But It never reaches the catch block.

How do i catch this exception

Please help

Thanks
Pavithra


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 9:36 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
I am not quite sure what you are after. Are you saying your application throws this exception, but does not end up in the appropriate catch block? Or do you try to explicitly trigger this exception by some sort of insert statement and it does not work?

Maybe you could post some example code and more details about your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 7:08 am 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Hi,

Are you running in an application server environment, as all hibernate exceptions are wrapped up into EJBException (runtime exception).

You will have to traverse the causes (.getCause() method ) of the exception of discover the underlying cuase of the exception.

Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 18, 2008 3:50 pm 
Newbie

Joined: Thu Jan 10, 2008 9:13 am
Posts: 4
Only thing I needed to do was to session.flush(), since I am using Spring based transaction usin aop


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