# Second Level Cache Put counts

**URL:** <https://discourse.hibernate.org/t/second-level-cache-put-counts/2114>\
**Category:** Hibernate ORM\
**Created:** [January 22, 2019, 2:18pm UTC](https://discourse.hibernate.org/t/second-level-cache-put-counts/2114 "2019-01-22T14:18:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmalhotra](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@rmalhotra](https://discourse.hibernate.org/u/rmalhotra)\
**Post date:** [January 22, 2019, 2:18pm UTC](https://discourse.hibernate.org/t/second-level-cache-put-counts/2114/1 "2019-01-22T14:18:41Z")

</div>

We are using hibernate version 4.3.11.  
We have a couple of java applications that refer to the same hibernate.cfg.xml, where in, second level cache and statistics are enabled.  
We have enabled second level caching for an entity in abc.hbm.xml as

> \<cache usage=“nonstrict-read-write”/\>

. It is joined to another table xyz, caching is enabled for that also using

> \<cache usage=“nonstrict-read-write”/\>

The statistics displayed in 1.log for one application is -

> Second Level Cache Counts: **Hits: 6 Misses: 2 Puts: 34**  
> Second Level Cache Region 0: com.abc.xyz -  
> Size In Memory: 400 **Element Count In Memory: 2**  
> Second Level Cache Region 1: com.abc -  
> Size In Memory: 21192 **Element Count In Memory: 32**

While the statistics displayed in the 2.log for another application is -

> Second Level Cache Counts: **Hits: 0 Misses: 0 Puts: 32**  
> Second Level Cache Region 0: com.abc.xyz -  
> Size In Memory: 0 **Element Count In Memory: 0**  
> Second Level Cache Region 1: com.abc -  
> Size In Memory: 0 **Element Count In Memory: 0**

The logs in 1.log make sense, as it has misses \> 0, so it is bound to have puts.  
But in 2.log there are no misses still 32 puts. Also the region information for it shows Element count in memory as 0. Then how come it has 32 puts. What are these puts?  
How can we know what is being put?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [January 22, 2019, 3:04pm UTC](https://discourse.hibernate.org/t/second-level-cache-put-counts/2114/2 "2019-01-22T15:04:41Z")

</div>

Try to replicate it with this [test case template](http://in.relation.to/2016/01/14/hibernate-jpa-test-case-template/) so we can see the issue.
