Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1012

Multi-threaded Singleton Lazy Instantiation Issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.1.1
    • container system
    • None

    Description

      Old code foolishly used an "if (instance == null) instance = createInstance()" which is not thread safe – my bad .

      Current code now uses Atomics and Futures to guarantee only one thread will win the right to lazily construct the singleton.

      Attachments

        Activity

          People

            dblevins David Blevins
            dblevins David Blevins
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: