1 Reply Latest reply on Nov 15, 2011 9:19 AM by derekvinyard

    jboss driver block

    derekvinyard

      Hi guys,

       

      I am using JBoss 4.0.2 (and am not in a position to upgrade) to run a Java+Hibernate+Struts+SQL Server 2008 application. Originally it was SQL Server 2005 for which I had a driver sqljdbc.jar, after a while a new server for 2008 was added so the driver was also updated to sqljdbc4.jar. Things worked perfectly for years, I could connect to both servers with the new driver without any problem, just the necessary changes in ds.xml. However for a couple of weeks JBoss get's blocked when using the newer driver whatever DB server I try to connect. Since then I have survived using the older driver and only connecting to the 2005 SQL server but I need access to the 2008 server also.

      There are no errors in the logs, here's an excerpt:

      19:48:09.798 INFO  [                    org.hibernate.util.NamingHelper] JNDI InitialContext properties:{}

      19:48:09.798 INFO  [  org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:comp/env/jdbc/t2br6

      19:48:09.798 DEBUG [   org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: registering pool with interval 900000 old interval: 9223372036854775807
      19:48:09.798 DEBUG [   org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: about to notify thread: old next: 1321120539798, new next: 1321120539798

      19:48:09.798 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=****, password=--hidden--}

      19:48:09.798 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Checking driver for URL: jdbc:sqlserver://1.1.2.2:1433;DatabaseName=ABC

      19:48:09.798 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver already registered for url: jdbc:sqlserver://1.1.2.2:1433;DatabaseName=ABC

      19:55:39.785 DEBUG [   org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
      20:03:09.742 DEBUG [   org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000

       

      It just doesn't do anything after the message "Driver already registered".

       

      The datasource file looks like this:

      <datasources>

        <local-tx-datasource>

          <jndi-name>t2br6</jndi-name>

          <connection-url>jdbc:sqlserver://1.1.2.1:1433;DatabaseName=ABC</connection-url>

          <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

          <user-name>ABC</user-name>

          <password>***</password>

          <min-pool-size>3</min-pool-size>

          <max-pool-size>10</max-pool-size>

          <blocking-timeout-millis>30000</blocking-timeout-millis>

          <idle-timeout-minutes>15</idle-timeout-minutes>

          <prepared-statement-cache-size>1000</prepared-statement-cache-size>

          <set-tx-query-timeout/>

          <query-timeout>300</query-timeout>

          <new-connection-sql>SET ANSI_WARNINGS OFF;SET LOCK_TIMEOUT 60000;SET CONCAT_NULL_YIELDS_NULL OFF;</new-connection-sql>

          <check-valid-connection-sql>SELECT 'check valid cnn hib'</check-valid-connection-sql>

          <track-statements>false</track-statements>    

      </local-tx-datasource>

        <no-tx-datasource>

          <jndi-name>t2br6_plain_jdbc</jndi-name>

          <connection-url>jdbc:sqlserver://1.1.2.2:1433;DatabaseName=ABC</connection-url>

          <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

          <user-name>ABC</user-name>

          <password>***</password>

          <min-pool-size>3</min-pool-size>

          <max-pool-size>10</max-pool-size>

          <blocking-timeout-millis>30000</blocking-timeout-millis>

          <idle-timeout-minutes>15</idle-timeout-minutes>

          <prepared-statement-cache-size>1000</prepared-statement-cache-size>

          <set-tx-query-timeout/>

          <query-timeout>300</query-timeout>

          <new-connection-sql>SET ANSI_WARNINGS OFF;SET LOCK_TIMEOUT 60000;SET CONCAT_NULL_YIELDS_NULL OFF;</new-connection-sql>

          <check-valid-connection-sql>SELECT 'check valid cnn jdbc'</check-valid-connection-sql>

          <track-statements>false</track-statements>    

        </no-tx-datasource>

      </datasources>.

       

      Since the problem appeared I have a new computer, fresh jboss installation, fresh Eclipse installation, new everything (except maybe the same internal IP). I don't know where and how to look for the problem. I can't think of no change that could cause this problem. Can you help?

      Regards,

      Derek

        • 1. Re: jboss driver block
          derekvinyard

          I found kind of a solution, downgrading de JVM from 1.6.29 to 1.6.27. However some of my colleagues have no problem when using 1.6.29 so I still don't know where the real problem is. Any ideeas on how to get to the real problem are still welcomed however I can move on.

          Another tested working solution may be to use the jTDS driver instead of the one from Microsoft, but this was not an acceptable solution in the long run for me.