This content has been marked as final.
Show 1 reply
-
1. Re: ApplicationScoped and SingletonEJB
marcelkolsteren Sep 17, 2010 8:35 AM (in response to nimo22)The problem is that you are comparing EJB Singletons with CDI application-scoped beans, while section 5.4 of the Weld documentation compares CDI singletons to CDI application-scoped beans.
So, in fact there are three ways of implementing a singleton:
- Use the EJB 3.1 singleton (annotation @javax.ejb.Singleton)
- Use a CDI bean in singleton pseudo scope (annotation @javax.inject.Singleton)
- Use a CDI bean in application scopeThe fact that JEE6 has two Singleton concepts with the same @Singleton annotation is quite confusing. I hope that CDI and EJB will blend further in JEE7. :-)