4 Replies Latest reply on Jun 17, 2008 3:28 PM by Marcel Kiel

    Application Scoped Service layer

    Mark Torres Newbie


      I'm new to seam and I'm coming from a spring background. I'm trying to fill in some gaps between the concepts I'm used to in Spring and the new concepts introduced by Seam.

      My question pertains to application scoped service layer. What's the best way to implement these stateless components in seam fashion?

      I realized from reading the reference manual that something like  the code below can cause synchronization issues.

      public class UserServiceImpl implements UserService {
           private Session bookingDatabase;


      I dont think using @Synchronized is the right approach because it may have a negative and significant impact on performance.

      What's a good approach to implementing such components? Are singletons components for this kind of scenario out of the question? I also want conversations to work transparently within this service layer. I'm currently trying to stay out of the J2EE container, so the setup is hibernate, and mostly pojo action and service layer.

      Any insight to this will be much appreciated.