glassfish
  1. glassfish
  2. GLASSFISH-17061

Issues on the database which doesn't support setClientInfo method

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 3.1.2_b14, 4.0
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All
      JDK: 6 or later

      Description

      Some databases don't support getClientInfo / setClientInfo method. I detected there are two issues when closing connections on the database which don't support setClientInfo method.

      1. In case of enabling SQL Trace Listeners
      The exception which occurs when calling setClientInfo method before closing connection is not handled appropriately because of the invocation through Proxy. As a result of the following example, JPA provider (EntityManagerSetupImpl.deploy) catches this exception and closing connections will be never executed.

      at $Proxy148.setClientInfo(Unknown Source)
      at com.sun.gjc.spi.jdbc40.ConnectionHolder40.setClientInfo(ConnectionHolder40.java:322)
      at com.sun.gjc.spi.jdbc40.ConnectionHolder40.close(ConnectionHolder40.java:530)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:617)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:233)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:394)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:237)
      at com.sun.enterprise.container.common.impl.EntityManagerWrapper._getDelegate(EntityManagerWrapper.java:208)
      at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:269)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.gjc.spi.JdbcObjectsFactory$1.invoke(JdbcObjectsFactory.java:143)
      ... 82 more

      2. In case of disabling SQL Trace Listeners
      RAR7115 message is output every time when closing connections as follow. I think this information is not useful for users who have already known the fact client info properties are not supported, and affects log size if many connections are used.

      [#|2011-07-19T12:30:45.685+1000|INFO|glassfish3.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=17;_ThreadName=Thread-2;|RAR7115: Unable to set ClientInfo for connection|#]
      [#|2011-07-19T12:30:50.479+1000|INFO|glassfish3.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=17;_ThreadName=Thread-2;|RAR7115: Unable to set ClientInfo for connection|#]
      [#|2011-07-19T12:30:52.698+1000|INFO|glassfish3.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=17;_ThreadName=Thread-2;|RAR7115: Unable to set ClientInfo for connection|#]

      The current Glassfish implementation always calls getClientInfo()/setClientInfo() regardless of supporting these methods. I suggest it should check whether the client info properties are supported or not in advance to resolve the above issues.

        Activity

        Hide
        emailnbw added a comment -

        FWIW I just filed this similar issue: http://java.net/jira/browse/GLASSFISH-18609

        Show
        emailnbw added a comment - FWIW I just filed this similar issue: http://java.net/jira/browse/GLASSFISH-18609
        Hide
        hanafey added a comment -

        This problem continues in GlassFish Server Open Source Edition 3.1.2.2 (build 5) (With Sybase jConnect v7 JDBC).

        Any chance this is going to be fixed? My comment 2 steps above seems to be a reasonable fix...

        Show
        hanafey added a comment - This problem continues in GlassFish Server Open Source Edition 3.1.2.2 (build 5) (With Sybase jConnect v7 JDBC). Any chance this is going to be fixed? My comment 2 steps above seems to be a reasonable fix...
        Hide
        rdelaplante added a comment -

        We're running GlassFish 3.1.2.2 in production (it is now October 2013) and see tons of these warnings in the log file:

        [#|2013-10-11T09:44:05.573-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=91;_ThreadName=Thread-2;|RAR7114: Unable to get ClientInfo for connection |#]

        [#|2013-10-11T09:44:05.576-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=91;_ThreadName=Thread-2;|RAR7115: Unable to set ClientInfo for connection|#]

        I'm not sure if it's the jTDS or PostgreSQL JDBC driver, but regardless it seems that this issue is not fixed and should be re-opened.

        Show
        rdelaplante added a comment - We're running GlassFish 3.1.2.2 in production (it is now October 2013) and see tons of these warnings in the log file: [#|2013-10-11T09:44:05.573-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=91;_ThreadName=Thread-2;|RAR7114: Unable to get ClientInfo for connection |#] [#|2013-10-11T09:44:05.576-0400|INFO|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=91;_ThreadName=Thread-2;|RAR7115: Unable to set ClientInfo for connection|#] I'm not sure if it's the jTDS or PostgreSQL JDBC driver, but regardless it seems that this issue is not fixed and should be re-opened.
        Hide
        sebastian2 added a comment -

        Hello,
        we are suffering the same problem is there any plan to fix this problem for 3.1.2.2?
        Thank you,
        Sebastian

        Show
        sebastian2 added a comment - Hello, we are suffering the same problem is there any plan to fix this problem for 3.1.2.2? Thank you, Sebastian
        Hide
        Lasse60 added a comment -

        Any solution for 3.1.2.2???

        Show
        Lasse60 added a comment - Any solution for 3.1.2.2???

          People

          • Assignee:
            Shalini
            Reporter:
            ito_m
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: