• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and data sharing

 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi:
I have never used EJB. I have a design issues, and I was told that using EJB could solve the problem, if so, I am going to study for the Cert.
The issue is, how to share information among all the component of the application, without quering the database often. ServletContext object doesn't work, becuase the information stored in the database con be changed at any time. Reintializing the ServeletContext object doesn't work, becuase the application is running on a clusterd app. server.
The summary: How can I share dynamic data in the application scope, without using database, or ServletContext object?
Can EJB do just that?
thanks
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried putting your objects (i.e. value objects populated from the database query) as attributes on session or application scope?
anthony
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Anthony for your reply.
Yes I have tried the application scope by storing the data in the ServletContext object. It works fine until the data in the database is changed. If the data in the database is changed, I have to reintialize the ServletContext object manualy, or redeploy the application, which is unecceptable. It would work fine in a one box application server, but in a clustered application server, they have more than one JVM, and each JVM has its own copy of the ServletConext object, hence, you have to reintialize them all. It is a cumbersom, and complicated task.
The session attribute will not work. The data to be shared is large, and it is the same for every group of users. If I save it in a user session, I will end up with a lote of huge and duplicate data in the memory.
any other suggestions.
thanks
[ April 06, 2004: Message edited by: Hanna Habashy ]
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the thread is coming into a servlet issue or SCWCD issue...
Anyway, I believe that your problem can be solved by EJB... But I'm not that expert in EJB, I hope that EJB experts in EJB forum can help you more about EJB things, rather than exam aspirants here in this forum... I'm just providing an alternative for the possible solution...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic