Beginner |
|
Joined: Mon Nov 08, 2004 11:58 am Posts: 29
|
I would like to start a discussion about inserting collections and cache
At the moment hibernate will treat a collection creation like and update in respective to caching. it will invalidate the CacheEntry. This is a huge performance nag as the first read of that collection will always go to the database. In my case there are 100s of concurrent reads that all go to the database, because the cache is not initialized.
To make it worse, I know that the collection will never be modified concurrently. The structure of my application garanties that. This makes the cautious caching stratagy for collection inserts even more painful.
I understand that the normal stratagy is to invalidate upon update/creation of collections to prevent concurrency problems. But I was wondering if this is also true for transactional and nonstrict-read-write cache.
nonstrict-read-write: per definition does not care about concurrency
transactional: the database insert and the cache insert would be in one transaction. per definition there should not be an update to the collection before the insert is in the cache.
The important thing is that collections are currently very bad for performance as the first access to a persistent collection will ALWAYS go to the database.
It would be great to have a solution for that.
|
|