Maybe try adding readOnly="false" serialize="true" to the cacheModel
I had huge issues trying to use queries cached by value (meaning your use of WHERE id=#value# ) it did not work for me. It didnt return the right object out of the read-only cache. Or it didnt find the object in the cache. Did you check in your logging to see the cache hit or miss? Kind Regards Meindert _____ From: Niels Beekman [mailto:[EMAIL PROTECTED] Sent: 04 July 2007 10:19 AM To: [email protected] Subject: RE: IBATIS map and Cache Did you enable the cache globally in your SqlMap config? _____ From: Gabriel Macerot [mailto:[EMAIL PROTECTED] Sent: woensdag 4 juli 2007 10:17 To: [email protected] Subject: IBATIS map and Cache I build a web application. Then I store data in a mysql data base and I use ibatis in order to map the requests for my application. For optimization I use LRU cache with the mapping about game_object_template (these objects may not change a lot). Here is my code : <!-- Modèle de cache --> <cacheModel id="GOT.cache" type="LRU"> <flushInterval hours="1"/> <flushOnExecute statement="GameObjectTemplate.insertOne" /> <flushOnExecute statement="GameObjectTemplate.updateOne" /> <property name="size" value="750" /> </cacheModel> <!-- Getters --> <select id="GameObjectTemplate.getOne" resultMap="GOT.map" cacheModel="GOT.cache"> SELECT * FROM game_object_templates WHERE id=#value# </select> <select id="GameObjectTemplate.getOneByName" resultMap="GOT.map" cacheModel="GOT.cache"> SELECT * FROM game_object_templates WHERE nom=#value# </select> <!-- List --> <select id="GameObjectTemplate.getAll" resultMap="GOT.map" cacheModel="GOT.cache"> SELECT * FROM game_object_templates got, sous_categories_objets sc, categories_objets c WHERE got.id_sous_categorie = sc.id AND sc.id_categorie_objet = c.id ORDER BY c.libelle, sc.libelle, got.nom </select> I used cache system for other request in my application but it seems here that nothing works like I want and the request still cost a lot of time. There is 300 game_object_templates in my data base and one game object got 13 field lots of varchar and some int (if it could help). Is someone could explain me why it doesnt work or if another solution exist in order to get these objects (There are often use) ? Mohicane
