jQuery in Action, 3rd edition
The moose likes OO, Patterns, UML and Refactoring and the fly likes Working with bulk Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Working with bulk" Watch "Working with bulk" New topic

Working with bulk

avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342

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
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
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 Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
As far as i know , no one of the cache above support in cache for request duration.
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
I'm not sure I understand how you'd plan to use the cache. Can you please elaborate? Thanks!

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
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 agree. Here's the link: http://aspose.com/file-tools
subject: Working with bulk
It's not a secret anymore!