File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Author

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

Gian Franco
blacksmith
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?

Thanks,

Gian Franco Casula


"Eppur si muove!"
Christian Bauer
author
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="http://www.manning.com/bauer" 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 - InfoQ.com
 
Don't get me started about those stupid light bulbs.
 
subject: Q 4 C. Bauer & G. King (10): database exceptions
 
Similar Threads
database procedures
Quick question on the B&S interface
MS Access NullPointerException
Exception chaining
writing from a jar