4 Replies Latest reply on Oct 6, 2008 12:18 PM by peterj

    Can EJB have an application scope?

      hi all,

      I am not getting any articles or blogs about the application scope or any scope of EJB. Can we have it in any way?

      In the anticipation of the answer
      Regards
      Mabimal

        • 1. Re: Can EJB have an application scope?
          peterj

          Scopes are associated with web applications. An EJB, on the other hand, is a back-end resource that can be used by multiple web applications, and each web application has its own application scope. So which application scope would the EJB use if there could be multiple ones?

          • 2. Re: Can EJB have an application scope?

            Thank you Peter J

            Now the concept is a bit clear to me.

            Regards
            Mabimal

            • 3. Re: Can EJB have an application scope?

              Hi PeterJ,

              I have written the connectionpool code in EJB and it gets established by the first call of portlet and i am in need to hold the established connection continuously so that other portlets can access the data. How can i maintain this level of persistence?
              Please Help me..!

              Regards
              Mabimal

              • 4. Re: Can EJB have an application scope?
                peterj

                You do not want to do that. Let the app server manage the database connection pool for you. Your EJB should get a connection from the app server when it needs to do database processing, and then release the connection when it is done.