Bonjour,

Je travaille sur un projet (en JSF) qui utilise comme vous l'aurez compris Hibernate (3.3.2GA) et une base de données, en l'occurrence Oracle 9i.
J'ai dans le back office de l'application un système de filtre qui me permet de restreindre les données affichées dans le tableau qui est affiché juste en dessous.
Ce tableau me permet de rentrer en modification sur mes données. Jusque là rien de bien extraordinaire me direz-vous.
Le problème est que lorsque je change la valeur d'une propriété de mon objet et que je fais la mise à jour dans le base de données. Je retourne sur la page avec le tableau est là lorsque je refiltre les données, j'ai soit la données à jour (tel qu'elle est dans la base) soit une version antérieur. Ce qui est bizarre c'est que d'une part ce n'est pas constant et d'autre part en affichant les requêtes je ne constate pas de différence.

Au niveau de ma configuration j'ai ce fichier hibernate.cfg.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
 
        <!-- Oracle Settings  com.p6spy.engine.spy.P6SpyDriver-->
        <property name="hibernate.connection.datasource">java:comp/env/jdbc/WebformDS</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</property>
        <!-- JDBC connection pool (use the built-in)-->
        <property name="hibernate.jdbc.batch_size">25</property>
 
 
        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>
 
        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">false</property>
        <property name="use_sql_comments">false</property>
 
        <!-- Enable tables' auto creation
 
        <property name="hibernate.generate_statistics">true</property>
        <property name="hibernate.cache.provider_class">
            org.hibernate.cache.SingletonEhCacheProvider</property>
        <property name="hibernate.cache.provider_configuration">
            /ehcache.cfg.xml</property>-->
 
        <property name="hibernate.cache.use_minimal_puts">false</property>
        <property name="hibernate.cache.use_query_cache">false</property>
        <property name="hibernate.cache.use_second_level_cache">false</property>
        <property name="hibernate.cache.use_structured_entries">false</property>
 
        <property name="hibernate.hbm2ddl.auto">validate</property>
 
        <mapping resource="my/project/webform/commons/entities/hbm/Language.hbm.xml" />
        <mapping
            resource="my/project/webform/commons/entities/hbm/Translation.hbm.xml" />
        <mapping resource="my/project/webform/commons/entities/hbm/InterAble.hbm.xml" />
        <mapping
            resource="my/project/webform/commons/entities/hbm/OtherInterlocutor.hbm.xml" />
        <mapping resource="my/project/webform/commons/entities/hbm/Request.hbm.xml" />
        <mapping resource="my/project/webform/commons/entities/hbm/State.hbm.xml" />
        <mapping resource="my/project/webform/commons/entities/hbm/StatArea.hbm.xml" />
 
        <mapping
            resource="my/project/webform/inter/entities/hbm/InterlocutorType.hbm.xml" />
        <mapping resource="my/project/webform/inter/entities/hbm/Interlocutor.hbm.xml" />
        <mapping resource="my/project/webform/inter/entities/hbm/Module.hbm.xml" />
        <mapping resource="my/project/webform/inter/entities/hbm/Classe.hbm.xml" />
 
        <mapping resource="my/project/webform/tel1/entities/hbm/Document.hbm.xml" />
 
    </session-factory>
</hibernate-configuration>
La connexion à la base de données est gérée au niveau d'une datasource déclarée avec un niveau d'isolation à 2.

J'ai essayé mais sans effet de mettre ehCache.

Voici le mapping de l'objet que j'affiche dans le tableau dont le parle ci-dessus.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="my.project.webform.inter.entities">
    <class name="Interlocutor" table="int_interlocutor">
            <cache usage="read-write"/>
        <id name="id" type="integer" column="INTERLOCUTOR_ID">
            <generator class="native" />
        </id>
 
        <property name="company" column="INTERLOCUTOR_COMPANY" type="java.lang.String"
            not-null="false" />
        <property name="name" column="INTERLOCUTOR_NAME" type="java.lang.String"
            not-null="false" />
        <property name="firstname" column="INTERLOCUTOR_FIRSTNAME" type="java.lang.String"
            not-null="false" />
        <property name="email" column="INTERLOCUTOR_EMAIL" type="java.lang.String"
            not-null="true" />
        <property name="address" column="INTERLOCUTOR_ADDRESS" type="java.lang.String"
            not-null="false" />
        <property name="zipCode" column="INTERLOCUTOR_ZIPCODE"
            type="java.lang.String" not-null="false" />
        <property name="city" column="INTERLOCUTOR_CITY" type="java.lang.String"
            not-null="false" />
        <property name="country" column="INTERLOCUTOR_COUNTRY" type="java.lang.String"
            not-null="false" />
        <property name="phone" column="INTERLOCUTOR_PHONE"
            type="java.lang.String" not-null="false" />
 
        <property name="fax" column="INTERLOCUTOR_FAX"
            type="java.lang.String" not-null="false" />
 
        <property name="webSite" column="INTERLOCUTOR_WEBSITE" type="java.lang.String" />
 
        <property name="mapLink" column="INTERLOCUTOR_MAPLINK" type="java.lang.String" />
 
        <bag name="activities" table="int_inter_activities">
            <key column="INTERLOCUTOR_ID" not-null="false" />
            <many-to-many class="my.project.webform.inter.entities.Activity"
                column="ACTIVITY_ID" />
        </bag>
 
        <bag name="modules" table="int_inter_modules" >
            <key column="INTERLOCUTOR_ID" not-null="false" />
            <many-to-many class="my.project.webform.inter.entities.Module"
                column="MODULE_ID" />
        </bag>
 
        <bag name="areas" table="int_inter_areas">
            <key column="INTERLOCUTOR_ID" not-null="true" />
            <many-to-many class="my.project.webform.inter.entities.Area"
                column="AREA_ID" />
        </bag>
 
        <many-to-one name="type" column="INTERLOCUTOR_TYPE"
            class="InterlocutorType" not-null="false" lazy="false"
            foreign-key="TYPE_ID" />
    </class>
</hibernate-mapping>
Lors de mes tests, je modifie les attributs "name", "company" etc.
Au niveau des mes requêtes:
- Tout ce qui de type Select est géré via Criteria
- Dès que je fais une requête modifiante j'ai essayé de faire session.clear(), session.flush() ou session.evict(monObjet) et sans succès voir même avec plus de problème au niveau chargement de données.

Une idée ?
Merci d'avance