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

Broken double-checked-locking in EmbeddedDataSource.findDriver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.4.2.0
    • 10.6.1.0
    • JDBC
    • None
    • all
    • 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

        1. alwaysSynchronize.diff
          2 kB
          Bryan Pendleton

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: