• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate cache and data from backend

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello authors,

I'm not aware of the caching layers provided by hibernate. If data gets into the database from the backend (say thro jdbc / using say an ETL tool) w/o hibernate cache being aware of it, is there a way to inform the cache about the data that has crept in from behind...programmatically i mean.

thanks
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK the caching mechanisms do their jobs when the application is the only one accessing the underlying data. In other cases I think it may give you more troubles than benefits.
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karthik,

Maybe the following thread interests
you on this topic.

Cheers,

Gian Franco Casula
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there no way to invalidate the cache programatically?. I mean there are certain workflows that might involve a bit of bulk data transfer. But otherwise rest of the workflows are say driven by the user O/L. So would i till be able to use the hibernate caching layer since it would improve the response ti,e dramatically and the user experience as a result?

thanks.
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karthik,

Look at this.

I hope you don't mind me hyperlinking you all the time

Cheers,

Gian Franco Casula
[ August 31, 2004: Message edited by: Gian Franco Casula ]
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gian Franco Casula:

I hope you don't mind me hyperlinking you all the time


nope not a problem at all!

But am not sure if understood the explanation correctly.
Is the author trying to say that the only reason we dont see the modified Cat data is because Hibernate Session has been reused / used incorrectly ?
 
Gavin King
author
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to manually invalidate the Hibernate second-level cache by calling SessionFactory.evictXXXX().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic