Hi 

I'm trying to add exception handling to one of my pages but I'm a little bit
stuck. 

I've got a page that loads an entity using a DAO (Hibernate, Spring). In
case of an error due to optimistic locking I want to reload the page with
the updated entity and display a message on a feedback panel. 

The onSubmit() method of my button looks like that: 

@Override 
public void onSubmit() { 
    // save store to DB 
    try { 
            storeDao.saveOrUpdate(store); 
            setResponsePage(StoreTablePage.class);      
    } catch (StaleObjectStateException ex) { 
             store = storeDao.retrieve(store.getId()); 
             error(new
StringResourceModel("form.error.optimisticLockingException", this,
null).toString()); 
    } 
} 

What is weird is that when I write "catch (StaleObjectStateException ex)"
then the exception is somehow intercepted and the catch section is never
reached, instead a stack trace of the exception is shown. When I change it
to "catch (Exception ex)" then it works as expected. At the moment I'm
running the Wicket application in development mode. 

Am I missing some important concept about exceptions in Wicket? 

Bye, 
Florian 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StaleObjectStateException-got-intercepted-tp3758154p3758154.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to