Can this Java singleton get rebuilt repeatedly in WebSphere 6?

后端 未结 10 976
清酒与你
清酒与你 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:47

    As others have mentioned, the static initializer will only be run once per classloader.

    One thing I would take a look at is the firstTime() method - why can't the work in doPreparations() be handled within the singleton itself?

    Sounds like a nasty set of dependencies.

提交回复
热议问题