-->
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: Exception mapping, MyException gets lost
PostPosted: Mon Mar 12, 2007 8:39 am 
Newbie

Joined: Thu Dec 14, 2006 11:17 am
Posts: 9
Hello,

I'm using Hibernate together with JPA, Spring and JSF 1.2.
In my data access layer I have methods to persist and update objects. These methods throw of course exceptions, but not the hibernate one.
Consider the following simple example:
Code:
public void persistObject(MyObject obj) throws MyPersistenceException {
  try {
    em.persist(obj);
  }
  catch(PersistenceException ex) {
    throw new MyPersistenceException(ex, "some info stuff");
  }
}


The presentation layer is realised by JSF 1.2. There I do the exception handling like this (in the FacesServlet):
Code:
public void service(ServletRequest req, ServletResponse res) {
  try {
    servlet.service(req, res);
  }
  catch (MyPersistenceException e) {
    // do handling
  }
  catch (Throwable t) {
    // ...
  }
}


If an exception occurs (the persistObject method throws MyPersistenceException) it's always mapped into a SQLServerException (I use SQLServer 2005) although it should be a MyPersistenceException.

So it's pretty hard to do correct exception handling.

Does anybody know why MyPersistenceException is ommited somewhere?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 20, 2007 4:32 am 
Newbie

Joined: Thu Dec 14, 2006 11:17 am
Posts: 9
Problem solved, it's a JSF related problem and fixed in the newest nightly build of JSF 1.2


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.