I reduced the loop from 5 to 2 cycles to get a smaller log. Interestingly the second and third request hits the database (5.th line, 'hibernate.SQL') with a different select statement than the first one. But I still would expect, there should not be any database hit in the second and third request at all.
First Request: 2010-04-22 14:41:08,933 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:08,935 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - query results were not found in cache 2010-04-22 14:41:08,936 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select this_.id as id0_0_, this_.version as version0_0_, this_.data1 as data3_0_0_, this_.data2 as data4_0_0_, this_.data3 as data5_0_0_ from composition this_ where (this_.data1=? and this_.data3=?) 2010-04-22 14:41:08,937 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - binding 'data1.1' to parameter: 1 2010-04-22 14:41:08,937 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - binding '1' to parameter: 2 2010-04-22 14:41:08,947 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '2' as column: id0_0_ 2010-04-22 14:41:08,949 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:08,949 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:08,949 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:08,949 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:08,949 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '22' as column: id0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '42' as column: id0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '62' as column: id0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '82' as column: id0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:08,950 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:09,018 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - caching query results in region: org.hibernate.cache.StandardQueryCache; timestamp=5209866522066944 2010-04-22 14:41:09,019 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:09,019 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - Checking query spaces for up-to-dateness: [composition] 2010-04-22 14:41:09,020 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.UpdateTimestampsCache - [composition] last update timestamp: 5209866491052037, result set timestamp: 5209866522066944 2010-04-22 14:41:09,022 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - returning cached query results
Second Request 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - Checking query spaces for up-to-dateness: [composition] 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.UpdateTimestampsCache - [composition] last update timestamp: 5209866491052037, result set timestamp: 5209866522066944 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - returning cached query results 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:15,041 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '2' to parameter: 1 2010-04-22 14:41:15,046 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:15,046 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:15,046 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:15,046 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:15,047 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:15,048 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '22' to parameter: 1 2010-04-22 14:41:15,050 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:15,050 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:15,050 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:15,050 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:15,051 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:15,051 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '42' to parameter: 1 2010-04-22 14:41:15,054 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:15,054 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:15,054 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:15,054 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:15,055 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:15,055 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '62' to parameter: 1 2010-04-22 14:41:15,058 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:15,058 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:15,058 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:15,058 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:15,059 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:15,059 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '82' to parameter: 1 2010-04-22 14:41:15,063 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:15,063 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:15,063 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:15,063 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:15,064 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:15,065 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - Checking query spaces for up-to-dateness: [composition] 2010-04-22 14:41:15,065 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.UpdateTimestampsCache - [composition] last update timestamp: 5209866491052037, result set timestamp: 5209866522066944 2010-04-22 14:41:15,065 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - returning cached query results
Third Request: 2010-04-22 14:41:17,719 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:17,720 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - Checking query spaces for up-to-dateness: [composition] 2010-04-22 14:41:17,720 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.UpdateTimestampsCache - [composition] last update timestamp: 5209866491052037, result set timestamp: 5209866522066944 2010-04-22 14:41:17,720 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - returning cached query results 2010-04-22 14:41:17,720 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:17,720 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '2' to parameter: 1 2010-04-22 14:41:17,728 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:17,728 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:17,728 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:17,728 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:17,729 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:17,729 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '22' to parameter: 1 2010-04-22 14:41:17,731 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:17,731 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:17,731 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:17,732 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:17,732 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:17,733 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '42' to parameter: 1 2010-04-22 14:41:17,735 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:17,735 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:17,735 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:17,735 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:17,736 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:17,736 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '62' to parameter: 1 2010-04-22 14:41:17,738 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:17,739 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:17,739 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:17,739 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:17,739 [http-localhost%2F127.0.0.1-8080-1] DEBUG hibernate.SQL - select compositio0_.id as id0_0_, compositio0_.version as version0_0_, compositio0_.data1 as data3_0_0_, compositio0_.data2 as data4_0_0_, compositio0_.data3 as data5_0_0_ from composition compositio0_ where compositio0_.id=? 2010-04-22 14:41:17,740 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - binding '82' to parameter: 1 2010-04-22 14:41:17,742 [http-localhost%2F127.0.0.1-8080-1] TRACE type.LongType - returning '0' as column: version0_0_ 2010-04-22 14:41:17,742 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data1.1' as column: data3_0_0_ 2010-04-22 14:41:17,742 [http-localhost%2F127.0.0.1-8080-1] TRACE type.StringType - returning 'data2.1' as column: data4_0_0_ 2010-04-22 14:41:17,742 [http-localhost%2F127.0.0.1-8080-1] TRACE type.IntegerType - returning '1' as column: data5_0_0_ 2010-04-22 14:41:17,744 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - checking cached query results in region: org.hibernate.cache.StandardQueryCache 2010-04-22 14:41:17,744 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - Checking query spaces for up-to-dateness: [composition] 2010-04-22 14:41:17,744 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.UpdateTimestampsCache - [composition] last update timestamp: 5209866491052037, result set timestamp: 5209866522066944 2010-04-22 14:41:17,744 [http-localhost%2F127.0.0.1-8080-1] DEBUG cache.StandardQueryCache - returning cached query results
|