Using the out of the box default caching I see the following in my hibernate debug. You can see where running a simple query for gene_id=2 which is the primary key of my gene table returns the same record and caches it twice. I would think the second time it runs the query it would find it in the cache. Anyone have any idea or see anything missing in this debug.:
15:23:07,154 WARN EhCacheProvider:97 - Could not find configuration [gov.nih.nci.camod.domain.impl.GeneImpl]; using defaults.
15:23:07,154 DEBUG EhCacheProvider:100 - started EHCache region: gov.nih.nci.camod.domain.impl.GeneImpl
15:23:07,420 WARN EhCacheProvider:97 - Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
15:23:07,420 DEBUG EhCacheProvider:100 - started EHCache region: org.hibernate.cache.StandardQueryCache
15:23:07,420 INFO SessionFactoryImpl:366 - Checking 0 named queries
Hibernate: select * from ( select this_.GENE_ID as GENE1_0_, this_.FULL_NAME as FULL2_135_0_, this_.CLUSTER_ID as CLUSTER3_135_0_, this_.SYMBOL as SYMBOL135_0_, this_.TAXON_ID as TAXON5_135_0_, this_.CHROMOSOME_ID as CHROMOSOME6_135_0_ from GENE_TV this_ where this_.GENE_ID=? ) where rownum <= ?
15:23:07,498 DEBUG LongType:59 - binding '2' to parameter: 1
15:23:07,514 DEBUG LongType:86 - returning '2' as column: GENE1_0_
15:23:07,529 DEBUG StringType:86 - returning 'N-acetyltransferase 2 (arylamine N-acetyltransferase)' as column: FULL2_135_0_
15:23:07,529 DEBUG LongType:86 - returning '2' as column: CLUSTER3_135_0_
15:23:07,529 DEBUG StringType:86 - returning 'NAT2' as column: SYMBOL135_0_
15:23:07,529 DEBUG LongType:86 - returning '5' as column: TAXON5_135_0_
15:23:07,545 DEBUG LongType:86 - returning '0' as column: CHROMOSOME6_135_0_
15:23:07,576 DEBUG ReadOnlyCache:58 - Caching: gov.nih.nci.cabio.domain.impl.GeneImpl#2
Hibernate: select * from ( select this_.GENE_ID as GENE1_0_, this_.FULL_NAME as FULL2_135_0_, this_.CLUSTER_ID as CLUSTER3_135_0_, this_.SYMBOL as SYMBOL135_0_, this_.TAXON_ID as TAXON5_135_0_, this_.CHROMOSOME_ID as CHROMOSOME6_135_0_ from GENE_TV this_ where this_.GENE_ID=? ) where rownum <= ?
15:23:12,670 DEBUG LongType:59 - binding '2' to parameter: 1
15:23:12,670 DEBUG LongType:86 - returning '2' as column: GENE1_0_
15:23:12,670 DEBUG StringType:86 - returning 'N-acetyltransferase 2 (arylamine N-acetyltransferase)' as column: FULL2_135_0_
15:23:12,670 DEBUG LongType:86 - returning '2' as column: CLUSTER3_135_0_
15:23:12,670 DEBUG StringType:86 - returning 'NAT2' as column: SYMBOL135_0_
15:23:12,670 DEBUG LongType:86 - returning '5' as column: TAXON5_135_0_
15:23:12,670 DEBUG LongType:86 - returning '0' as column: CHROMOSOME6_135_0_
15:23:12,686 DEBUG ReadOnlyCache:58 - Caching: gov.nih.nci.cabio.domain.impl.GeneImpl#2
Hibernate: select count(*) as y0_ from GENE_TV this_ where this_.GENE_ID=?
15:23:12,733 DEBUG LongType:59 - binding '2' to parameter: 1
15:23:12,733 DEBUG IntegerType:86 - returning '1' as column: y0_
ORMDAOImpl ===== count = 1
Hibernate: select count(*) as y0_ from GENE_TV this_ where this_.GENE_ID=?
15:23:12,780 DEBUG LongType:59 - binding '2' to parameter: 1
15:23:12,780 DEBUG IntegerType:86 - returning '1' as column: y0_
ORMDAOImpl ===== count = 1
_________________ M Connolly
|