In CDI there is the @ApplicationScoped
and the (javax.inject
) @Singleton
pseudo-scope. What is the difference between them? Besides th
@Singleton
in JSR-299 refers to Singleton session beans (javax.ejb.Singleton
, not javax.inject.Singleton
), not JSR-299 managed beans in a built-in scope called Singleton.
You might find in your server that @ApplicationScoped
is one-per EAR or one-per WAR/EJB-JAR as it is not clear in the specification, but you should definitely not expect it to be one per JVM.