• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

sharing huge data across JSPs

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There,
I am facing the following problem, I have to share huge data around 1.5 MB across JPS. It is fetched from DAO (SOAP service) and stored in
HashMap as name value pairs. Note that this data will be refreshed every two day so it is sought of static and dyanmic as well.

I am thinking
Option 1: I would make the HashMap a bean and store it in ApplicationContext.

Option 2: Code a Server Socket and serve the value given the key that way the Server space is light weight and the data is avaiable to the nodes in the clustered env.


Please give me your valuable thoughts.

-Arin Paul
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you already have this huge map in memory, storing a reference to it in the application context will cost you nothing except the reference itself.

Also, there's really no need to make a bean out of it; you can store any object type in the context.
 
arin paul
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response.

I agree with your suggestion. But the only problem I see is, how do I share it across JVMs in mutiple nodes?

I once again appreciate your valuable response.

-Paul
 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is a horse of a different color and beyond my realm of expertise.

When you talk of different JVMs are you talking about a clustered environment? Or merely separate servers?
 
arin paul
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to have confused you.
It is a clustered env with multiple nodes each node is a seperate server (box) hence a seperate JVM.

[I was thinking I would serialize the map to central location(dir) and share it across the nodes and not use the socket approach. Not sure.]

Regards,
Paul
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic