Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with bulk

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • 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

 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
As far as i know , no one of the cache above support in cache for request duration.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic