Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4124

Broken double-checked-locking in EmbeddedDataSource.findDriver

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.6.1.0
    • Component/s: JDBC
    • Labels:
      None
    • Environment:
      all
    • Urgency:
      Normal

      Description

      org.apache.derby.jdbc.EmbeddedDataSource.findDriver() uses the
      double-checked-locking idiom for setting the 'driver' variable. This
      idiom is, however, not correct and hence the code is broken. The fix
      is to remove the outer if, i.e. to always enter the synchronized block.

      See also
      http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

        Attachments

          Activity

            People

            • Assignee:
              bryanpendleton Bryan Pendleton
              Reporter:
              ronald@innovation.ch Ronald Tschalaer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: