-->
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: DB-independent exception handling?
PostPosted: Thu Jul 07, 2005 10:00 am 
Newbie

Joined: Thu Jul 07, 2005 9:37 am
Posts: 1
Hello Guys.

I'm prototiping a new app, and I'm kind of stuck with this.

I've seen that, when you get an exception while doing an operation with Hibernate, you can catch things like "ConstraintViolationException" , that abstracts the error condition for different engines.

The problem I'm having, is that all of these return the same exception:
1. Duplicated PK/UK
2. FK violation
3. Check constraint exception

How am I supposed to know what kind of error triggered the ConstraintViolationException? I know I have the error message inside the exception, but that's db-specific. I know I can get the name of the exception violated, but how can I know what does that name relates to (specially since I'm using HBM2DDL to generate the schema) ?

Thanks in advance for any advice you can give me on this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 07, 2005 2:49 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 8:18 pm
Posts: 23
The Spring project provides decent way to handle this. Check out http://docjar.com/docs/api/org/springfr ... ctory.html

(I believe there's another project that deals with this same problem but the name slips my mind)


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.