3 Replies Latest reply on Jan 30, 2003 4:15 PM by Peter Doornbosch

    Expert opinion for a novice

    seemanto Newbie

      I need some expert opinion on this. We want to introduce ejb in an existing web application im which all modules
      are multiuser.

      For the sake of minimizing interactions with the database a decision has been taken to have entity
      bean instances with each instance representing a single row of data of a particular table to be kept active through stateful
      sesionbeans in an user session. Now in an user session there will be many table accessed and that means many sets (considering one set to map to a particular table)
      of active entity bean instances in an entire session. On top of it as all modules are multiuser and because we dont want to share
      entity bean instances across sessions, there will be replication of the same set of entity beans in the server.
      All this add up to the concern that the system will finally support a very few concurrent users and even that cannot be fixed because
      with the increase in the database the required number of active instances will also increase. Is there a way around.
      Any suggestions or redirection to any useful study material will be helpful.

        • 1. Re: Expert opinion for a novice
          Peter Doornbosch Apprentice

          Why are you trying to write your own cache? EJB was designed for this stuff. Let JBoss do the (caching) job for you, it is probably even doing better than you can ever achieve by writing your own caching mechanism.
          And if you don't believe me: why not just try it first? It's for free!

          Make sure you use commit option A, this will minimize database transactions and cache the entity beans. Try it out, do measure the performance. You'll be surprised how fast it is.

          • 2. Re: Expert opinion for a novice
            seemanto Newbie

            yes the container sure does do caching.But isn't it a overhead to to maintain so many entity beans in ACTIVE state during a client session ?

            • 3. Re: Expert opinion for a novice
              Peter Doornbosch Apprentice

              > yes the container sure does do caching.But isn't it a
              > overhead to to maintain so many entity beans in
              > ACTIVE state during a client session ?

              Sorry, i don't get your point. You can specify the size of the cache (min and max) in the jboss deployment descriptor. JBoss will try to keep the entity beans in memory, especially when you use commit option A. Yes, that will cost some memory, but that is what caching is about, isn't it? The advantage of letting JBoss do the caching is that it will dispose certain rarely used entity beans when the max size of the cache is reached.

              Hope this does answer your question, if not let me know.