Can this Java singleton get rebuilt repeatedly in WebSphere 6?

后端 未结 10 953
清酒与你
清酒与你 2021-02-13 13:26

I\'m trying to track down an issue in our system and the following code worries me. The following occurs in our doPost() method in the primary servlet (names have been changed

10条回答
  •  抹茶落季
    2021-02-13 13:27

    In theory it will be built only once. However, this pattern breaks in various application servers, where you can get multiple instances of 'singleton' classes (since they are not thread-safe).

    Also, the singleton pattern has been critized a lot. See for instance Singleton I love you, but you're bringing me down

提交回复
热议问题