• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Working with bulk

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

my system work most in a bulk, so performance and loading are very important.

I want to advice with you about one of the main functionality in the application - "import items"

I get items need to validate them and merge them (if new create else merge).

item is a complex graph of objects.

I don't love that layers depends on another layers and they are not stateless , but as far as i see it i have to have kind of cache (if the entity was loaded take it from the cache) for the process .
I think thread local can be a good platform for this cache.

Any ideas or another view will be welcome.

Thank you

 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't build what you can buy or get free. There are plenty of open-source cache implementations around (for instance JCS) and also plenty of commercial products like IBM's WebSphere eXtreme Scale and Oracle's Coherence that will probably work fine for you as a caching layer.

Kyle
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as i know , no one of the cache above support in cache for request duration.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand how you'd plan to use the cache. Can you please elaborate? Thanks!
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the beginning of the process load the data that needed.(can be a lot of entities type)
Store each entity type in its own map , and store all those map in the thread local.

The same idea like the session in hibernate.
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic