I'm currently creating an EJB3 Data Access Class to handle all database operations in my Java EE 6-application. Now, since Java EE 6 provides the new ApplicationScoped
annotation, I wonder what state my EJB should have, or if it should be stateless.
Would it be better to let the DAO be a @Stateless
Session Bean, or an @ApplicationScoped
Bean? What about @Singleton
? What are the differences between these options related to a DAO?
EDIT:
I'm using Glassfish 3.0.1 with the full Java EE 6 platform
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…