Results 1 to 4 of 4

Thread: Hibernate checked Exceptions

  1. #1
    Join Date
    Sep 2004
    Location
    Argentina
    Posts
    23

    Default Hibernate checked Exceptions

    I was trying to use the HibernateTemplate's method createCriteria and found that there's no wrapping for Hibernate's checked exception HibernateException in this method.
    Why isn't the exception being converted to a Spring's unchecked exception?
    - N!K -

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Simply because HibernateException is never thrown in this method body.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Sep 2004
    Location
    Argentina
    Posts
    23

    Default

    If not, why is it declared in the method's signature?
    - N!K -

  4. #4
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    Actually, as the JavaDoc states, you are really expected to use this inside a HibernateCallback (as you get when using the execute method). The execute method will do the exception translating for you.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  2. Replies: 3
    Last Post: Jul 6th, 2005, 10:37 PM
  3. No rollback with exceptions using Hibernate
    By elwell642 in forum Data
    Replies: 4
    Last Post: Feb 8th, 2005, 08:52 AM
  4. Replies: 2
    Last Post: Dec 20th, 2004, 04:35 PM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •