5 Replies Latest reply on Mar 22, 2004 3:08 AM by idxp

    Entity Bean Explosion?

    idxp

      The project I am handling has the following features:

      1. Quite a lot(hundreds of thousand) entity beans will be created
      2. And they will NEVER be removed

      The project is to enhance a legacy project which used JDBC directly to persist data.

      I also understand that EJB will be passivated and be put into the pool so that App Server will not be out of memory.

      The question is that, even if an EJB is passivated, will it still occupy some resources on App Server? If yes, what kind of resource is occupied? If there are several million EJBs created and then passivated, will they exhaust resources of App Server since they will never be removed?

      In the legacy system, this is not the problem. Because it used JDBC, all data only exists in DB, not App Server. I am going to enhance it using EJB. But due to the above considerations, I am hesitating whether to use it or not since it may require a huge amount resource to be added to App Server. (BTW, I am using JBOSS as App Server)

      Any suggestions?



        • 1. Re: Entity Bean Explosion?
          aloubyansky

          When an instance is passivated it is evicted from the cache. No resources are occupied.

          • 2. Re: Entity Bean Explosion?
            idxp

            If an entity bean is evicted from cache, where it will go?

            I think the instance will be returned to pool. But where is the context of the instance? Is it totally stored in DB? Or it will remain some tracking records on app server?

            How about if I create 1 million beans and then come back to call the first bean created, which has been passivated?

            According sun's spec, container will call ejbActive () to get an instance from pool, give it an context(associate it with the EJB object) and then use it. Question is, where the app server gets the context for the bean? Totally from DB or somewhere on app server?

            • 3. Re: Entity Bean Explosion?
              darranl

              Are you reading the spec for session beans or entity beans?

              • 4. Re: Entity Bean Explosion?
                aloubyansky

                > I think the instance will be returned to pool. But where is the context of the instance?

                It is thrown away.

                > Question is, where the app server gets the context for the bean?

                Just creates a new instance.

                • 5. Re: Entity Bean Explosion?
                  idxp

                  Ok....

                  If this is what Jboss does, I will feel comfort using it in my project.

                  Thanks a lot!


                  "loubyansky" wrote:
                  > I think the instance will be returned to pool. But where is the context of the instance?

                  It is thrown away.

                  > Question is, where the app server gets the context for the bean?

                  Just creates a new instance.