ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Meindert" <meind...@pastelebusiness.com>
Subject RE: IBATIS map and Cache
Date Wed, 04 Jul 2007 09:22:19 GMT
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 didn’t return the right object out of the
read-only cache. Or it didn’t find the object in the cache.


Did you check in your logging to see the cache hit or miss?


Kind Regards






From: Niels Beekman [mailto:n.beekman@wis.nl] 
Sent: 04 July 2007 10:19 AM
To: user-java@ibatis.apache.org
Subject: RE: IBATIS map and Cache


Did you enable the cache globally in your SqlMap config?



From: Gabriel Macerot [mailto:g.macerot@omegames.com] 
Sent: woensdag 4 juli 2007 10:17
To: user-java@ibatis.apache.org
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" />



    <!-- Getters -->

    <select id="GameObjectTemplate.getOne" resultMap="GOT.map"

        SELECT * FROM game_object_templates WHERE id=#value#



    <select id="GameObjectTemplate.getOneByName" resultMap="GOT.map"

        SELECT * FROM game_object_templates WHERE nom=#value#



    <!-- List -->

    <select id="GameObjectTemplate.getAll" resultMap="GOT.map"

        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



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 doesn’t work or if another solution exist
in order to get these objects (There are often use) ?



View raw message