EJB Pattern


EJB design: EJB Pattern

  1. EJB Pattern (4 messages)

    Dear all EJB professional,

    I’m a newbie of EJB and I have a question EJB design pattern. My application is try to cache lots of static data from database daily and I created a session bean to call number of methods for caching modules. However, some of the method calls are very time consuming and it made my session bean timeout. To prevent the session timeout by adjust the timeout value in the session bean. But I think this is not the best solution to solve my situation. Is there any other good EJB pattern to solve my case? By use MDB and JMS?


    Threaded Messages (4)

  2. EJB Pattern[ Go to top ]


    I am not sure why you would want to cache static data on a "daily" basis. Ideally, static data is one which does not change over a period of time. A nice time to cache such data is the time when the application starts up on the application server either by using a Startup Class or a Startup Servlet.

    Moreover, it would be really great if you could fire all the different methods for all the modules which let you cache data in a parallel way using JMS and MDBs. This will ensure that the methods of the modules run in an almost parallel way. This could also be accessed using the startup class and the servlet.

    Hope this helps. If you have further questions, please fell free to post them and it would also help if you could explain the problem and the implementation you are looking at in greater detail.

    Thanks and Regards,

  3. How this "Start" class work? If it is a servelet, how the "Start" use MDB. What kinds of methods would be in the "Start" class. Thanks!
  4. Which App Server you are using. In weblogic you can use T3StartupDef.
  5. EJB Pattern[ Go to top ]

    Dear Vishnu,

    Thank you for your help and your information is very helpfull to me. Now I adopted MDB + JMS to load up my silly daily data to cache. Is good to use MDB + JMS coz it can provide a good recovery handling.

    Coz I'm using Websphere and there is a build-in startup class.

    Thank you very much,