Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB 3.1 singleton in cluster

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

like image 670
d1x Avatar asked Dec 07 '10 10:12

d1x


2 Answers

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".

like image 117
Brett Kail Avatar answered Oct 02 '22 07:10

Brett Kail


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".

like image 33
jonfornari Avatar answered Oct 02 '22 08:10

jonfornari