Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christian Bauer
author
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[...]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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic