Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prooblem with Level 2 Cache

 
Akshay Bondre
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use EHCHACHE. But, not able to get updated data across sessions.

I tried following..
> Using "getSessionFactory.getCurrentSession()"
In this case, I need to start a transaction and commit it. If I further close the session then I get the updated attributes across sessions which are direct attributes of the class but not the lazily fetched.([sets])

> Using "getSessionFactory.openSession()"
I dont need to open transactions and close them all the time, + the lazy data is available through out the object life. But, in this case, the data is not being updated across the sessions.

Help!
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean when you say the data is not getting updated across multiple sessions? How many sessions do you have in existence?

I notice you're using openSession rather than getSession? Is there a reasoning behind this choice?

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic