I am using Java 1.4/1.5 with hibernate 2.1.8. And I wanted to some scheduled batch task.
But I found that the performance drops very fast as the content in session cache keep growing. I have to flush()&clear() the session every 1000 loop.
(There will be over 50k records will be processed each batch)
Cache supposed to raise overall performance, but it not. I want to use the cache, but use it smart. I want to keep my FLUSHMODE. I take a few look at source, and found Session likely using simple HashMap for session cache (correct me if not).
Can I limit the size of the Map? Or using something like WeakHashMap/LRUHashMap?
|