singletons and threadsafety

Discussions

General J2EE: singletons and threadsafety

  1. singletons and threadsafety (1 messages)

    Hello,

    I am thinking about making my DAOFactory a singleton and reading following article about singletons:

    http://c2.com/cgi/wiki?JavaSingleton

    which led to another article:

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

    Honestly, it got me more confused that informed about how to implement my singleton DAOFactory.

    Any thoughs?

    PI
  2. singletons and threadsafety[ Go to top ]

    Honestly, it got me more confused that informed about how to implement my singleton DAOFactory.Any thoughs?PI

    Well, what is it exactly that you're confused about?
    I think both articles are pretty clear?
    A third one you might want to have a look at is

    http://www-106.ibm.com/developerworks/java/library/j-jtp03304/

    Look for the section 'Initialize-On-Demand Holder Class idiom'.

    HTH,
    Stefan