2 Replies Latest reply on Mar 12, 2009 7:30 AM by thiagu.m

    stateful vs stateless vs pojo conversation component

      hi every one


      i am using the seam suggested conversation scope in my project.
      but i have the doubt for where we use stateful session bean ,stateless session bean and pojo.


      i am cleared about pojo. if we use the pojo we can't access ejp services and also we can run the project outside of ejb container.


      i am not cleared stateful and stateles session bean.


      when i need to use the stateful and stateless session bean . which one gives better perfomance , with correct memory management (without any memory leak).is there any profiler perfomance proof available.


      most of the java experts suggest to use the stateless session bean with long running conversaction is enough for maintain the state. is it correct .


      by
      thiagu.m


        • 1. Re: stateful vs stateless vs pojo conversation component
          swd847

          You cannot use Stateless beans in conversation scope, only stateful. Stateless beans can only be bound to the stateless scope.


          Stateless and stateful beans offer the following additional features:


          - More advanced Container managed transactions, including REQUIRES_NEW
          - The ability to inject an entityManager using @PersistenceContext instead of @In so you can get a transaction scoped entityManager.
          - Instance pooling for stateless beans so you do not have to create a new bean every request
          - Passivation to disk for statefull beans, so if the server is running low on memory idle beans can be swapped out.


          Performance wise it depends on the app and what you are using them for.

          • 2. Re: stateful vs stateless vs pojo conversation component

            thank you for ur reply
            now i am clear with stateful and stateless


            by
            Thiagu