Faking Entity Beans in Tomcat?

Discussion in 'Java' started by Andoni, Jul 16, 2004.

  1. Andoni

    Andoni Guest

    Hello,

    Maybe what I want is not to fake entity beans but I will explain what I am
    trying to achieve. Each time a user logs on to my website the incur a
    number of database queries. Firstly to get their details, then the list of
    their suppliers and the list of their permissions on the site.

    I want to store this information at application level so as to cut out many
    of the DB queries that are being done, but there are a few problems:
    1. It has to be possible to update any user in real time or to create a new
    one and have them function immediately.
    2. I don't know if there would be too much information being stored at
    application level?
    3. I am limited to Apache Tomcat and hence no Entity beans (which I believe
    take care of these things?).

    Can anyone suggest a pattern for doing this?

    Thanks in advance,

    Andoni.
    Andoni, Jul 16, 2004
    #1
    1. Advertising

  2. Andoni

    Murray Guest


    > 1. It has to be possible to update any user in real time or to create a

    new
    > one and have them function immediately.


    If it wasn't for this requirement, you could simply stick the user data into
    the session. I assume you mean you want to be able to modify the user's
    state from some other "place" in the application, i.e. outside the user's
    session by an admin user or something along those lines. Is that what you
    mean?


    > 2. I don't know if there would be too much information being stored at
    > application level?


    Well obviously that depends on the amount of data involved, how many users
    will be using the site concurrently, and the amount of memory available on
    the server. All things that only you know at the moment ;-) But if the
    queries to grab the data take a while, then I'd say it's an acceptable
    compromise to store the data in memory to improve performance, as long as
    it's not a massive amount of data.
    Murray, Jul 16, 2004
    #2
    1. Advertising

  3. Andoni

    Andoni Guest

    Yes, I have an admin application which allows me add/change/delete users'
    details. This would have to synch with the data stored in application
    level.

    I don't have too many users at the moment so I don't see holding the data in
    application (ServletContext) level being a problem.

    Surely the data couldn't be held in session level as each user creates a new
    separate session when they log in?

    Another aspect I have started to consider is that this site should be
    distributable across two Tomcat servers. Would I be right in saying that
    this is going to be a problem if I'm storing the data at application level?
    I am going to have to check the user's details in application and then if
    they are not there check the database for them and pull them into
    application. I think I'll do that anyway, then I'll be ready for making it
    distributable! Am I right?

    Andoni.


    "Murray" <> wrote in message
    news:40f7c0d4$0$16105$...
    >
    > > 1. It has to be possible to update any user in real time or to create a

    > new
    > > one and have them function immediately.

    >
    > If it wasn't for this requirement, you could simply stick the user data

    into
    > the session. I assume you mean you want to be able to modify the user's
    > state from some other "place" in the application, i.e. outside the user's
    > session by an admin user or something along those lines. Is that what you
    > mean?
    >
    >
    > > 2. I don't know if there would be too much information being stored at
    > > application level?

    >
    > Well obviously that depends on the amount of data involved, how many users
    > will be using the site concurrently, and the amount of memory available on
    > the server. All things that only you know at the moment ;-) But if the
    > queries to grab the data take a while, then I'd say it's an acceptable
    > compromise to store the data in memory to improve performance, as long as
    > it's not a massive amount of data.
    >
    >
    Andoni, Jul 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kabal
    Replies:
    0
    Views:
    935
    Kabal
    Jul 22, 2003
  2. MP
    Replies:
    2
    Views:
    2,604
    John C. Bollinger
    Nov 11, 2003
  3. Tim

    Entity beans

    Tim, Jan 25, 2004, in forum: Java
    Replies:
    4
    Views:
    565
    Ashton
    Jan 26, 2004
  4. Torsten Schmeissel
    Replies:
    0
    Views:
    417
    Torsten Schmeissel
    Apr 29, 2005
  5. markla
    Replies:
    1
    Views:
    545
    Steven Cheng
    Oct 6, 2008
Loading...

Share This Page