This is the output if I don't explicitly call Hibernate.initialize():
Ideally, we shall see cache hit for all those PodcastCategoryMapping objects, but we only see the root object cache hit, "Podcast".
Hibernate: select this_.ID as ID1_1_, this_.RSS_FEED_URL as RSS2_1_1_, this_.TITLE as TITLE1_1_, this_.SUBTITLE as SUBTITLE1_1_, this_.DESCRIPTION as DESCRIPT5_1_1_, this_.SOURCE_ID as SOURCE6_1_1_, this_.POSTER_FILE_URL as POSTER7_1_1_, this_.IS_VALID as IS8_1_1_, this_.IS_PUBLISHED as IS9_1_1_, this_.AUTHOR as AUTHOR1_1_, this_.KEYWORDS as KEYWORDS1_1_, this_.LAST_UPDATED as LAST12_1_1_, this_.LAST_UPDATED_BY as LAST13_1_1_, this_.EXPLICIT as EXPLICIT1_1_, this_.LAST_BUILD_DATE as LAST15_1_1_, this_.ITUNES_CATEGORY as ITUNES16_1_1_, this_.primary_category_id as primary17_1_1_, podcastcat2_.POD_ID as POD2_3_, podcastcat2_.ID as ID3_, podcastcat2_.ID as ID3_0_, podcastcat2_.POD_ID as POD2_3_0_, podcastcat2_.CAT_ID as CAT3_3_0_, podcastcat2_.POS as POS3_0_ from podcasts_catalog.podcast this_ left outer join podcasts_catalog.podcast_category_mapping podcastcat2_ on this_.ID=podcastcat2_.POD_ID where this_.ID in (?) order by this_.TITLE asc TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.PodcastCategoryMapping#1 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.PodcastCategoryMapping#1 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.Podcast#1 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.Podcast#1 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.PodcastCategoryMapping#2 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.PodcastCategoryMapping#2 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.PodcastCategoryMapping#3 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.PodcastCategoryMapping#3 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.PodcastCategoryMapping#4 TRACE | 2009-08-01 23:36:49,125 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.PodcastCategoryMapping#4 TRACE | 2009-08-01 23:36:49,140 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.PodcastCategoryMapping#5 TRACE | 2009-08-01 23:36:49,140 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.PodcastCategoryMapping#5 TRACE | 2009-08-01 23:36:49,140 | org.hibernate.cache.ReadWriteCache | 173 | Caching: com.pcs.core.db.entities.Podcast.podcastCategoryMappings#1 TRACE | 2009-08-01 23:36:49,140 | org.hibernate.cache.ReadWriteCache | 185 | Cached: com.pcs.core.db.entities.Podcast.podcastCategoryMappings#1 DEBUG | 2009-08-01 23:36:49,140 | org.hibernate.cache.StandardQueryCache | 94 | caching query results in region: org.hibernate.cache.StandardQueryCache; timestamp=5116702756352000 DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 127 | checking cached query results in region: org.hibernate.cache.StandardQueryCache DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 185 | Checking query spaces for up-to-dateness: [podcasts_catalog.podcast] DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 142 | returning cached query results DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 127 | checking cached query results in region: org.hibernate.cache.StandardQueryCache DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 185 | Checking query spaces for up-to-dateness: [podcasts_catalog.podcast] DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 142 | returning cached query results DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 127 | checking cached query results in region: org.hibernate.cache.StandardQueryCache DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 185 | Checking query spaces for up-to-dateness: [podcasts_catalog.podcast] DEBUG | 2009-08-01 23:36:49,156 | org.hibernate.cache.StandardQueryCache | 142 | returning cached query results TRACE | 2009-08-01 23:36:49,156 | org.hibernate.cache.ReadWriteCache | 100 | Cache lookup: com.pcs.core.db.entities.Podcast#1 TRACE | 2009-08-01 23:36:49,156 | org.hibernate.cache.ReadWriteCache | 110 | Cache hit: com.pcs.core.db.entities.Podcast#1
|