[hibernate-dev] NullPointerException in SettingsFactory#buildSettings() when database not available in 3.6.FINAL

jan zelenka zelenka.jan at gmail.com
Wed Feb 2 12:00:20 EST 2011


In above mention method there is a protection against dead database and
dialect is build via

dialect = DialectFactory.buildDialect( props );

when exception is thrown from line

                Connection conn = connections.getConnection();

e.g. when database is not available.

However there is no such protection when exception is thrown later from line

                DatabaseMetaData meta = conn.getMetaData();

which is in inner try-catch block (code does not hit
any DialectFactory.buildDialect( props );  then)

This can happen for certain connection pools (atomikos in my case).

Subsequently, NullPointerException on line 169 is hit.

I think call to DialectFactory.buildDialect( props ) also in inner catch
block on line 140  would solve it nicelly.



More information about the hibernate-dev mailing list