Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

OpenJpa query caching is not refreshing in case of null value  RSS feed

Awadhendra Tiwari
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Morning everyone,

I am facing some problem in OpenJpa second level caching. Most of times caching is working but in one particular case it is not working. Here is a scenario when it is not working,
When your code result null value then it store it into cache and then it never clear that value. Although it clears values only when query returns a value.

Here is code which I had written to get value from database,

And here is a code which refresh cache.

And this is persistence.xml code

Everything working fine when query always returns value. The problem is start when it return null value. Then first time is store in cache and then it never refresh.
I am using OpenJpa2 and Hibernate. Help me as I am stuck here from last 3 days and I didn't get any solution.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!