-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Caching not taking place on update
PostPosted: Fri Jul 15, 2005 4:38 am 
Newbie

Joined: Thu Jun 02, 2005 5:03 am
Posts: 15
I am trying to update some data, but its not being put in cache. I tried to debug and found that the following is happening -

1. TreeCache PUT Region = /net/sf/hibernate/cache/UpdateTimestampsCache Key = T_TKOP_OPER_PROFILE
2. Hibernate: update T_TKOP_OPER_PROFILE set LST_NM=? where OPER_ID=?
3. TreeCache REMOVE Region = /test/TTkopOperProfile Key = OP10

I dont understand why TreeCache.REMOVE is getting called instead of TreeCache.PUT.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2005 2:36 am 
Newbie

Joined: Thu Jun 02, 2005 5:03 am
Posts: 15
i have figured this out. This is happening because i have set the dynamic-update attribute in hbm to true.

When dynamic-update is set to true, insert and update invalidate the cache. Does anyone knows why this is happening?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2005 2:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It happens because I explicitly coded it to happen.

In BasicEntityPersister:

Code:
   public boolean isCacheInvalidationRequired() {
      return hasFormulaProperties() || ( !isVersioned() && ( entityMetamodel.isDynamicUpdate() || getTableSpan() > 1 ) );
   }


In general, Hibernate knows waaay more about when it is safe to add things to the cache than you will probably think of for yourself.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.