开发者

EJB 3.1 singleton in cluster

开发者 https://www.devze.com 2023-01-29 01:07 出处:网络
I didn\'t find much information about EJB 3.1 Singletons in cluster enviroment. Is it true开发者_StackOverflow中文版 that specification says that those singletons will guarantee one instance per JVM -

I didn't find much information about EJB 3.1 Singletons in cluster enviroment. Is it true开发者_StackOverflow中文版 that specification says that those singletons will guarantee one instance per JVM - so one per cluster node. Not one per whole cluster?


Yes, section 4.8 of the EJB 3.1 specification states that "each application will have one bean instance of the Singleton for each JVM".


The singleton itself does not guarantee one instance per cluster. For that you need to specify a dependency. If you are using jboss then it is "jboss.ha:service=HASingletonDeployer,type=Barrier".

0

精彩评论

暂无评论...
验证码 换一张
取 消