Hi,
On server's side I use hibernate to communicate with database. However, if the database is offline I can't catch any exception related with the connection. What's more, on client's site where gwt is used, onFailure(Throwable caught) function is executed, but caught.printStackTrace(); prints nothing. I want gwt to inform a user that the database is currently unavailable, but as you can read I can't catch any exception which can help me to do that. Any ideas?
update:
e.g.
public class HibernateUtil
{
private static final SessionFactory sessionFactory;
static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
...
Session session = null;
try
{
session = HibernateUtil.getSessionFactory().openSession();
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
}
In both cases no exception is catched if the database is offline, so I'm not able to send a message about the problem with connection to the client
Thanks in advance