java.sql.SQLException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I've posted this problem in Hibernate forum on Thu Jul 07, 2005 and viewed almost 2000 times but no reply yet. Please let me know if this is a legitimate bug or is there a better way to detect network failures. When Hibernate builds session factory initially it prints an error message "Could not obtain connection metadata" and prints a SQLException stack trace if the network is not available but doesn't throw an expcetion. When I looked at org.hibernate.cfg.SettingsFactory.buildSettings method it catches the SQLException and logs it but doesn't re-throw it, not even a HibernateExpcetion. So, I couldn't get a handle to exception and stop the process. Is there any other way to detect the network availability before opening a session? Will an Exception be thrown from this method in the next release? Code snippet from org.hibernate.cfg.SettingsFactory --------------------------------------------------- try { Connection conn = connections.getConnection(); try { DatabaseMetaData meta = conn.getMetaData(); metaSupportsScrollable = meta.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE); if ( ( batchSize > 0 ) && !meta.supportsBatchUpdates() ) batchSize = 0; if ( Environment.jvmSupportsGetGeneratedKeys() ) { try { Boolean result = (Boolean) DatabaseMetaData.class.getMethod("supportsGetGeneratedKeys", null).invoke(meta, null); metaSupportsGetGeneratedKeys = result.booleanValue(); } catch (AbstractMethodError ame) { metaSupportsGetGeneratedKeys = false; } catch (Exception e) { metaSupportsGetGeneratedKeys = false; } } } finally { connections.closeConnection(conn); } } catch (SQLException sqle) { log.warn("Could not obtain connection metadata", sqle); } catch (UnsupportedOperationException uoe) { // user supplied JDBC connections } [b]Hibernate version:[/b] 3.0.5 [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] 2005-07-07 11:45:21,290 WARN main cfg.SettingsFactory Could not obtain connection metadata java.sql.SQLException: The application requester cannot establish the connection.(No route to host: connect) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:460) at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:2673) at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:878) at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:769) at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:355) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:118) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1505) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1053) at com.hfa.jacl.persist.common.HibernateService.initialize(HibernateService.java:493)
    via by Muthu,
  • I've posted this problem in Hibernate forum on Thu Jul 07, 2005 and viewed almost 2000 times but no reply yet. Please let me know if this is a legitimate bug or is there a better way to detect network failures. When Hibernate builds session factory initially it prints an error message "Could not obtain connection metadata" and prints a SQLException stack trace if the network is not available but doesn't throw an expcetion. When I looked at org.hibernate.cfg.SettingsFactory.buildSettings method it catches the SQLException and logs it but doesn't re-throw it, not even a HibernateExpcetion. So, I couldn't get a handle to exception and stop the process. Is there any other way to detect the network availability before opening a session? Will an Exception be thrown from this method in the next release? Code snippet from org.hibernate.cfg.SettingsFactory --------------------------------------------------- try { Connection conn = connections.getConnection(); try { DatabaseMetaData meta = conn.getMetaData(); metaSupportsScrollable = meta.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE); if ( ( batchSize > 0 ) && !meta.supportsBatchUpdates() ) batchSize = 0; if ( Environment.jvmSupportsGetGeneratedKeys() ) { try { Boolean result = (Boolean) DatabaseMetaData.class.getMethod("supportsGetGeneratedKeys", null).invoke(meta, null); metaSupportsGetGeneratedKeys = result.booleanValue(); } catch (AbstractMethodError ame) { metaSupportsGetGeneratedKeys = false; } catch (Exception e) { metaSupportsGetGeneratedKeys = false; } } } finally { connections.closeConnection(conn); } } catch (SQLException sqle) { log.warn("Could not obtain connection metadata", sqle); } catch (UnsupportedOperationException uoe) { // user supplied JDBC connections } [b]Hibernate version:[/b] 3.0.5 [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] 2005-07-07 11:45:21,290 WARN main cfg.SettingsFactory Could not obtain connection metadata java.sql.SQLException: The application requester cannot establish the connection.(No route to host: connect) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:460) at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:2673) at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:878) at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:769) at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:355) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:118) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1505) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1053) at com.hfa.jacl.persist.common.HibernateService.initialize(HibernateService.java:493)
    via by Muthu,
  • JDBC connection errors
    via by 843859,
  • Connection Pool Problem
    via by bsch...@my-deja.com,
  • as400 driver
    via by alan_sec,
  • Daily Log file no longer working
    via Stack Overflow by Demilich1988
    ,
    • java.sql.SQLException: The application requester cannot establish the connection.(No route to host: connect) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:460) at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:2673) at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:878) at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:769) at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:355) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:118) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1505) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1053) at com.hfa.jacl.persist.common.HibernateService.initialize(HibernateService.java:493)

    Users with the same issue

    marcbouvierdav
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    5 more bugmates