unable to catch org.hibernate.StaleObjectStateException while deleting record that doesn't exists in database
- by JAB
My application has a delete user option. Now in order to check concurrency condition I tried the following use case
opened application in chrome and firefox browser.
deleted user in firefox
now trying to delete the same user in chrome browser I get exception org.hibernate.StaleObjectStateException .. which is right .. since I am trying to delete an object which doesn't exists. But I am not able to catch this exception
try{
getHibernateTemplate().delete(userObj);
} catch (StaleObjectStateException e) {
e.printStackTrace();
}
How do i catch this exception ??