Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-7102

Remote datasource usage is not threadsafe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.1.2 ER1
    • EAP_EWP 5.1.1
    • JCA
    • None
    • Hide

      1) Deploy a datasource not using the java JNDI context
      2) Run a client which looks up the remote datasource and then spawns multiple threads which repeatedly run trivial queries.

      Shortly after you will likely state getting errors about connections or statements not being found, and potentially experience high cpu usage by JBoss if threads get stuck in HashMap.put()

      Show
      1) Deploy a datasource not using the java JNDI context 2) Run a client which looks up the remote datasource and then spawns multiple threads which repeatedly run trivial queries. Shortly after you will likely state getting errors about connections or statements not being found, and potentially experience high cpu usage by JBoss if threads get stuck in HashMap.put()
    • Hide
      Datasources exposed remotely via RMI used the maps of connections and statements in a way that was not threadsafe. This resulted in either clients receiving an error message "unable to find statement" or the server getting stuck in an infinite loop due to the map data structure being corrupted. This issue has been resolved by changing the method of access to the remote datasource's map, so that it is thread-safe.
      Show
      Datasources exposed remotely via RMI used the maps of connections and statements in a way that was not threadsafe. This resulted in either clients receiving an error message "unable to find statement" or the server getting stuck in an infinite loop due to the map data structure being corrupted. This issue has been resolved by changing the method of access to the remote datasource's map, so that it is thread-safe.
    • Documented as Resolved Issue
    • NEW

      org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService stores connections, statements and other objects in HashMaps. Since the wrapper can be used by multiple threads at once (by multiple clients), access to the maps need to be thread-safe, but they are not.

      If concurrent access occurs, the maps can become corrupted and either lose entries or get stuck in an infinite loop in HashMap.put (The latter is harder to reproduce as it requires structural changes to the data structure).

        1. JBPAPP-7102.diff
          2 kB
        2. AccessTest.java
          1 kB
        3. hsqldb2-ds.xml
          5 kB

              jpederse@redhat.com Jesper Pedersen
              rhn-support-jlivings James Livingston (Inactive)
              Russell Dickenson Russell Dickenson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: