Hi
I'm trying to connect to a non-existent server (this happens for example, when I disconnect my machine from the network) in which case when I try to create the SessionFactory I get an infinite, repeating, exception loop.
This is my code:
Code:
    public synchronized void setConfiguration(Configuration configuration) throws HibernateException
    {
        SessionFactory oldSF = sessionFactory;
        try
        {
            sessionFactory = configuration.buildSessionFactory();
            System.out.println("Using database: " + configuration.getProperty("hibernate.connection.url"));
            try {if (oldSF != null) oldSF.close();} catch (HibernateException he){}
        }
        catch (HibernateException he)
        {
            sessionFactory = oldSF; // failed to setup new config so carry on using the current one.
            throw he;
        }
    }
I *think* this is a bug in c3p0 but I could be wrong. Any thoughts?
I'm using the jtds driver and the latest hibernate2.
Edward
Code:
java.sql.SQLException: Network error IOException: No route to host
   at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:307)
   at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
   at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:145)
   at java.sql.DriverManager.getConnection(DriverManager.java:512)
   at java.sql.DriverManager.getConnection(DriverManager.java:140)
   at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:66)