glassfish
  1. glassfish
  2. GLASSFISH-19120

"Unable to get ClientInfo for connection" logged at INFO level zillions of times with Sybase jConnect v7

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jdbc
    • Labels:
      None

      Activity

      Hide
      hanafey added a comment -

      The following is a sample of the logged messages:

      [#|2012-10-02T13:10:16.392-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
      RAR7114: Unable to get ClientInfo for connection |#]
      
      [#|2012-10-02T13:10:16.399-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
      RAR7115: Unable to set ClientInfo for connection|#]
      
      [#|2012-10-02T13:10:16.402-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
      RAR7114: Unable to get ClientInfo for connection |#]
      
      [#|2012-10-02T13:10:16.403-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName=Thread-2;|
      RAR7115: Unable to set ClientInfo for connection|#]
      

      The INFO level logging happens with Sybase jConnect 7 because in the method below (in ConnectionHolder40), the "getClientInfoProperties" method throws "com.sybase.jdbc4.utils.UnimplementedOperationException: The method com.sybase.jdbc4.jdbc.SybDatabaseMetaData.public ResultSet getClientInfoProperties() has not been completed and should not be called."

      If this statement was moved inside of the try block, then the logging would only happen at level FINEST (but the catch block would need a more general exception since the Sybase exception extends java.lang.UnsupportedOperationException.

          private boolean isSupportClientInfo() throws ResourceException, SQLException {
              Boolean isSupportClientInfo = getManagedConnection().isClientInfoSupported();
              if (isSupportClientInfo != null) {
                  return isSupportClientInfo;
              } else {
                  ResultSet rs = getManagedConnection().getCachedDatabaseMetaData().getClientInfoProperties();  <<<==============
                  try {
                      isSupportClientInfo = rs.next();
                      getManagedConnection().setClientInfoSupported(isSupportClientInfo);
                      return isSupportClientInfo;
                  } finally {
                      try {
                      rs.close();
                      } catch(SQLException ex) {
                          if(_logger.isLoggable(Level.FINEST)) {
                              _logger.log(Level.FINEST, "jdbc.unable_to_get_client_info", ex);
                          }
                          return false;
                      }
                  }
              }
          }
      
      Show
      hanafey added a comment - The following is a sample of the logged messages: [#|2012-10-02T13:10:16.392-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName= Thread -2;| RAR7114: Unable to get ClientInfo for connection |#] [#|2012-10-02T13:10:16.399-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName= Thread -2;| RAR7115: Unable to set ClientInfo for connection|#] [#|2012-10-02T13:10:16.402-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName= Thread -2;| RAR7114: Unable to get ClientInfo for connection |#] [#|2012-10-02T13:10:16.403-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=103;_ThreadName= Thread -2;| RAR7115: Unable to set ClientInfo for connection|#] The INFO level logging happens with Sybase jConnect 7 because in the method below (in ConnectionHolder40), the "getClientInfoProperties" method throws "com.sybase.jdbc4.utils.UnimplementedOperationException: The method com.sybase.jdbc4.jdbc.SybDatabaseMetaData.public ResultSet getClientInfoProperties() has not been completed and should not be called." If this statement was moved inside of the try block, then the logging would only happen at level FINEST (but the catch block would need a more general exception since the Sybase exception extends java.lang.UnsupportedOperationException. private boolean isSupportClientInfo() throws ResourceException, SQLException { Boolean isSupportClientInfo = getManagedConnection().isClientInfoSupported(); if (isSupportClientInfo != null ) { return isSupportClientInfo; } else { ResultSet rs = getManagedConnection().getCachedDatabaseMetaData().getClientInfoProperties(); <<<============== try { isSupportClientInfo = rs.next(); getManagedConnection().setClientInfoSupported(isSupportClientInfo); return isSupportClientInfo; } finally { try { rs.close(); } catch (SQLException ex) { if (_logger.isLoggable(Level.FINEST)) { _logger.log(Level.FINEST, "jdbc.unable_to_get_client_info" , ex); } return false ; } } } }
      Hide
      kithouna added a comment -

      The H2 Database driver (1.3.170) has the exact same issue. It's rather annoying...

      Show
      kithouna added a comment - The H2 Database driver (1.3.170) has the exact same issue. It's rather annoying...
      Hide
      andykaufmann added a comment -

      GlassFish 4.0 and h2 version 1.3.172 same warning:

      Information: RAR7114: Unable to get ClientInfo for connection
      Information: RAR7115: Unable to set ClientInfo for connection

      If someone knows how to disable this.. thank you

      Show
      andykaufmann added a comment - GlassFish 4.0 and h2 version 1.3.172 same warning: Information: RAR7114: Unable to get ClientInfo for connection Information: RAR7115: Unable to set ClientInfo for connection If someone knows how to disable this.. thank you

        People

        • Assignee:
          sfelts
          Reporter:
          hanafey
        • Votes:
          1 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated: