DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: J2EE Caching

  1. #1
    Brad O'Hearne Guest

    J2EE Caching


    Welcome! I have a question regarding J2EE caching. Let's suppose I have
    a data structure, somewhat complex and time-consuming to build, not persisted
    in a RDBMS, that I would like to cache and expose to my EJB's. What is the
    best way to accomplish this?

    Some gotcha's here:
    1)Because of the nature of the data structure we want to cache (memory/perf
    intensive to build) it does not make a good candidate for an EJB itself,
    because we do not want our EJB container creating multiple instances of this
    2) Because this data structure is essentially a Singleton, how do we expose
    a single-instance of this data structure to the EJB's in a *non app-server
    specific* (i.e. portable manner)?

    I look forward to your response!



  2. #2
    Robert Glass Guest

    Re: J2EE Caching


    Related to this Question. I have a Controller Facade that talks to 19 other
    BMP entity Beans. Whats is the best way to handle caching each of these beans
    Interfaces so I don't have to keep finding by primary key or getting the
    home each time. Intereset to hear you approach to this.


    Bob Glass
    TRW Software Eng.

  3. #3
    Bjarki Holm Guest

    Re: J2EE Caching

    Hello Brad!

    A proper solution to this problem will always depend on the scale and nature
    of the system in question. But I have actually been dealing with a similar
    problem myself recently, so I will discuss below how I solved that, for my
    particular system.

    In my setup, I had a cluster of servers, each running HTTP and application
    servers. HTTP requests were directed to a specific server by means of a load
    balancing mechanism in front of the "middle tier".

    Similar to your problem, I had to access a particular data object from each
    application server. This data object was designed to be a Singleton, so the
    problem was how I should share the instance between different application

    As a solution, I invented for each application server an event manager, that
    listened after all Events that were fired for the application. When the Singleton
    data object was modified on a particular server (no chance to know which
    one, since the application was load-balanced), an object-modified-event was
    fired, and caught by the event manager. The event manager would contact all
    the other event managers through a message-driven EJB bean (if you are not
    using an EJB 2.0 compliant bean container, you could simply use JMS or even
    RMI). When an event manager was contacted by another event manager, he would
    take appropriate action on the local data object instance, thus ensuring
    integrity and portability for the whole system.

    I hope you understand what I'm getting at here. Of course, there are probably
    many other solutions to this problem, some of which might be more appropriate
    in your situation.

    Let me know what you think!



  4. #4
    Bjarki Holm Guest

    Re: J2EE Caching


    I'm sorry I haven't got back to you earlier

    If I'm not misunderstanding, I would think that your facade implementation
    should be able to store these references in some type of collection object.
    How is the facade set up? Are you performing in a clustered environment?

    Please give me some more details, so that I can better visualize the scenerio.



Similar Threads

  1. Running J2EE Client problem
    By Duong Thanh An in forum Java
    Replies: 0
    Last Post: 07-25-2002, 10:10 PM
  2. Setting up the J2EE 1.3 SDK with Windows 2000
    By Mark Yadav in forum Java
    Replies: 0
    Last Post: 07-04-2002, 01:32 PM
  3. Looking for J2EE Work!!!
    By Anthony Perritano in forum Careers
    Replies: 0
    Last Post: 12-01-2001, 06:45 AM
  4. .NET vs J2EE Presentation in Sacramento, California
    By Rich Newbold in forum dotnet.announcements
    Replies: 0
    Last Post: 05-09-2001, 06:46 PM
  5. Replies: 0
    Last Post: 05-08-2000, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.