hello
some o-r mapping tools can cache the objects that have been queried,then next time these objects are required,it don't need to access the database again,it can also monitor the database updating.
i wonder how i can implement such "cache" function MANUALLY? because i DON'T want to use ANY o-r mapping tools. i only use the jdbc to query database,then generate the object.
who can give me some clue?? or articles? or sample codes??
thank you!!!!!
-
how to cache the objects MANUALLY?? (4 messages)
- Posted by: u u
- Posted on: March 17 2005 06:07 EST
Threaded Messages (4)
- how to cache the objects MANUALLY?? by Matan Amir on March 17 2005 07:43 EST
- how to cache the objects MANUALLY?? by Thomas Chille on March 17 2005 08:14 EST
- how to cache the objects MANUALLY?? by Martin Straus on March 30 2005 13:39 EST
- how to cache the objects MANUALLY?? by Thomas Chille on April 03 2005 03:54 EDT
- how to cache the objects MANUALLY?? by Martin Straus on March 30 2005 13:39 EST
-
how to cache the objects MANUALLY??[ Go to top ]
- Posted by: Matan Amir
- Posted on: March 17 2005 07:43 EST
- in response to u u
Most ORM solutions use plugins to provide second-level cache functionality. That means that those cache solutions can be used directly.
Try searching for Java cache libraries.
Some popular ones are:
JBoss Cache
EHCache
OSCache
Hope that helps,
Matan -
how to cache the objects MANUALLY??[ Go to top ]
- Posted by: Thomas Chille
- Posted on: March 17 2005 08:14 EST
- in response to u u
I use a simple solution. Every SELECT-string act as key for the resultung collection of business objects wich are stored in a hashmap.
You have to take care that the map is not getting to big and have to remove less used objects from the map.
On startup u can fill the cache with often used SELECTs like Fetch All and Fetch One. -
how to cache the objects MANUALLY??[ Go to top ]
- Posted by: Martin Straus
- Posted on: March 30 2005 13:39 EST
- in response to Thomas Chille
The SELECT is the key of the hashmap???? Horror!!! -
how to cache the objects MANUALLY??[ Go to top ]
- Posted by: Thomas Chille
- Posted on: April 03 2005 15:54 EDT
- in response to Martin Straus
The SELECT is the key of the hashmap???? Horror!!!
Please give me more details, what makes you so scared. Its a really simple, not much adjustable or scalable solution. But it works and speeded up an old application up to 100 times within one hour invested time.