Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-7071

use-try-lock option in data source configuration files is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 6.0.0.M4
    • JBossAS-5.1.0.GA
    • JCA service
    • None
    • Workaround Exists
    • Hide

      This appears to work, but is admittedly a hack:
      Get the JBoss source
      Modify BaseWrapperManagedConnectionFactory to include another method:
      public void setUseTryLock(long useTryLock)

      { this.useTryLock = (int) useTryLock; }

      jar this and place the jar ahead of the other jars in the classpath (e.g. at JBOSS_HOME\common\lib )

      I added a static initializer block that does some logging, and that seems to indicate that it is getting loaded.

      Show
      This appears to work, but is admittedly a hack: Get the JBoss source Modify BaseWrapperManagedConnectionFactory to include another method: public void setUseTryLock(long useTryLock) { this.useTryLock = (int) useTryLock; } jar this and place the jar ahead of the other jars in the classpath (e.g. at JBOSS_HOME\common\lib ) I added a static initializer block that does some logging, and that seems to indicate that it is getting loaded.

      (FYI your "READ THIS BEFORE ENTERING NEW REPORTS" points to a "You caught us doing a little maintenance..." page, so pardon me if I missed something in procedure. )

      The data source configuration property "use-try-lock" is effectively ignored.
      This is because the value is defined in configuration as a long, but the object that is actually set on an

      org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory extends
      org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory

      This class defines it as taking an int, not a long:

      public void setUseTryLock(int useTryLock)

      As such, reflection in ManagedConnectionFactoryDeployment.setManagedConnectionFactoryAttribute() does not find the method and simply logs it at a trace level, so the value never gets set.

              jpederse@redhat.com Jesper Pedersen
              mjconstar Mike Conner (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: