This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Q 4 C. Bauer & G. King (10): database exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Q 4 C. Bauer & G. King (10): database exceptions" Watch "Q 4 C. Bauer & G. King (10): database exceptions" New topic

Q 4 C. Bauer & G. King (10): database exceptions

Gian Franco
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
Dear authors,

How are database exceptions, errors, e.g. due to
PK/FK constraints, passed back to the application
by Hibernate?


Gian Franco Casula

"Eppur si muove!"
Christian Bauer
Ranch Hand

Joined: Aug 31, 2004
Posts: 45
Hibernate doesn't add any uneccessary semantics to exceptions: You get a HibernateException which wraps a JDBC SQLException. In Hibernate 2.x, the HibernateException is a checked exception, Hibernate3 has a RuntimeException.

Co-Author of <a href="" target="_blank" rel="nofollow">Hibernate in Action</a>
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
[...]Hibernate3 has a RuntimeException.

This one is one of my favourites in Hibernate3. I have done this from the beginning of my Hibernate usage (putting there some dymnamic proxying).

blog -
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Q 4 C. Bauer & G. King (10): database exceptions
It's not a secret anymore!