2 Replies Latest reply on Apr 13, 2011 5:10 AM by Leo van den berg

    Concurrent Access to Seam Component

    Wolfgang Bergbauer Newbie

      Hi all,

      sorry for my lack of the technical details here, but still trying to learn.
      To simplify lets assume I have the following POJO components:

      - gateway (EventScope)
      - commandScheduler (ApplicationScope)
      - job (EventScope)

      now the job is executed by quartz. I am setting up everything in the commandScheduler and creating a job with a reference to the gateway.
      Since I am storing the gateway in a class variable in the commandScheduler, this eventscope has basically the same lifecycle as the whole application scope.

      Now my questions:
      Since all jobs basically share the same gateway instance, how does this affect my performance? Could I run into concurrency problems? This is almost like a pojo singleton.
      On the other hand I could always create a new gateway instance for every job and pass it to the new job, but this is also kind of expensive.
      Finally this could be a good use case for a stateless session bean.

      Thanks a lot for some theoretical insight.