Hi;
I am using hibernate 3.2.4-sp1.
It seems that the filtering on collections disable the cache.
The relevant mapping is :
@OneToMany(mappedBy = "completeOffer", targetEntity = CalendarImpl.class, fetch = FetchType.LAZY)
@Where(clause = "DisponibiliteTO = 1 and Supprime = 0 and TarifTtc is not null")
@Filter(name = "currentDate", condition = ":currentDate < DateDepart")
@OrderBy(value = "startingDate")
@Cache(region = "OffreComplete.calendars", usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public List<ICalendar> getCalendarsInternal() {
return calendars;
}
When I disable the filter, the cache works.
The traces are identical for each call so I don't understand why the cache is not activated.
NB. :currentDate is computed once a day.
Some post mentioned the case but workarounds can't be applied in my case (
viewtopic.php?f=1&t=996130&p=2410041&hilit=filter+second+cache#p2410041,
viewtopic.php?f=1&t=995924&hilit=filter+second+cache,
viewtopic.php?f=1&t=994295&hilit=filter+second+cache)
select calendarsi0_.OffreCompleteId as OffreCo11_1_, calendarsi0_.CalendrierId as Calendri1_1_, calendarsi0_.CalendrierId as Calendri1_48_0_, calendarsi0_.DisponibiliteTO as Disponib2_48_0_, calendarsi0_.PrixBrochure as PrixBroc3_48_0_, calendarsi0_.OffreCompleteId as OffreCo11_48_0_, calendarsi0_.Supprime as Supprime48_0_, calendarsi0_.DateRetour as DateRetour48_0_, calendarsi0_.DernierePlace as Derniere6_48_0_, calendarsi0_.ReferenceTO as Referenc7_48_0_, calendarsi0_.PrixVente as PrixVente48_0_, calendarsi0_.DateDepart as DateDepart48_0_, calendarsi0_.tarifTtc as tarifTtc48_0_ from integrationtests_catalogue.Calendrier calendarsi0_ where ? < calendarsi0_.DateDepart and ( calendarsi0_.DisponibiliteTO = 1 and calendarsi0_.Supprime = 0 and calendarsi0_.TarifTtc is not null) and calendarsi0_.OffreCompleteId=? order by calendarsi0_.DateDepart asc
15:31:15,579 | {http-8080-3} | [TRACE] | [org.hibernate.type.TimestampType] : binding '2009-07-03 23:59:00' to parameter: 1
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : binding '33383' to parameter: 2
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '14291369' as column: Calendri1_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '1' as column: Disponib2_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '0' as column: PrixBroc3_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '33383' as column: OffreCo11_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '0' as column: Supprime48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.DateType] : returning '05 décembre 2009' as column: DateRetour48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '0' as column: Derniere6_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.StringType] : returning '' as column: Referenc7_48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '1399' as column: PrixVente48_0_
15:31:15,594 | {http-8080-3} | [TRACE] | [org.hibernate.type.DateType] : returning '27 novembre 2009' as column: DateDepart48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '1399' as column: tarifTtc48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '33383' as column: OffreCo11_1_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '14291369' as column: Calendri1_1_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '14291372' as column: Calendri1_48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '1' as column: Disponib2_48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '0' as column: PrixBroc3_48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '33383' as column: OffreCo11_48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '0' as column: Supprime48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.DateType] : returning '06 décembre 2009' as column: DateRetour48_0_
15:31:15,610 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '0' as column: Derniere6_48_0_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.StringType] : returning '' as column: Referenc7_48_0_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '1399' as column: PrixVente48_0_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.DateType] : returning '28 novembre 2009' as column: DateDepart48_0_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.BigDecimalType] : returning '1399' as column: tarifTtc48_0_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '33383' as column: OffreCo11_1_
15:31:15,641 | {http-8080-3} | [TRACE] | [org.hibernate.type.IntegerType] : returning '14291372' as column: Calendri1_1_Is it a bug, a feature that is not implemented or a configuration error ?
regards