ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: IBATIS map and Cache
Date Wed, 04 Jul 2007 08:19:07 GMT
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" />

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

 

Mohicane


Mime
View raw message