Bonsoir,

Je galère sur la configuration d'ehcache d'hibernate avec Spring

Voilà une partie du mon applicationContext.xml concernant Hibernate & EhCache

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
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      	<property name="dataSource"><ref local="dataSource"/></property>
      	<property name="hibernateProperties">
	     	<props>
	       		<prop key="hibernate.dialect">
	         		org.hibernate.dialect.MySQLDialect
	       		</prop>
	       		<prop key="hibernate.show_sql">
	         		true
	       		</prop>
 
	       	    <prop key="hibernate.cache.provider_class">
	       			net.sf.ehcache.hibernate.EhCacheProvider
	       		</prop>
	       		<prop key="hibernate.cache.use_query_cache">
	       			true
	       		</prop>
	       		<prop key="hibernate.cache.use_second_level_cache">
	       			true
	       		</prop>
	       		<prop key="hibernate.cache.use_structured_cache">
	       			true
	       		</prop>
	       		<prop key="hibernate.cache.use_minimal_puts">
	       			true
	       		</prop> 
	     	</props>
	   	</property>
      	<property name="annotatedClasses">
			<list>
				<value>com.leaderinfo.novanet.entity.commons.CurrentSelection</value>
			</list>
	  	</property>
   </bean>
VOilà mon fichier ehcache.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
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
    <diskStore path="C:\ehcache"/>
    <cache name="org.hibernate.cache.StandardQueryCache"
        maxElementsInMemory="1000" 
        timeToLiveSeconds="60" 
        timeToIdleSeconds="60"
        overflowToDisk="false" 
        eternal="false" />
 
    <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="60"
        timeToLiveSeconds="60"
        overflowToDisk="false" />
</ehcache>
Je ne comprends pas, je me suis mis dans un test unitaire (et même une JSP), je charge un objet, je le recharge derrière immédiatement et malheureusement hibernate reli en base (show_sql = true me le prouve)

Comment faire pour que ce dernier fonctionne ?

Merci a vous