-->
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.  [ 2 posts ] 
Author Message
 Post subject: Query cache invalidation from dependant table
PostPosted: Mon Nov 07, 2005 12:38 pm 
Newbie

Joined: Tue Mar 08, 2005 8:00 am
Posts: 10
Hibernate version: 3.1rc2

I'm using query cache in an application that gets values from a view, but writes changes on tables.

The query of the view V1 is something like that:

SELECT A.SOMETHING, B.SOMETHING_ELSE FROM A, B WHERE ...

The problem rises when I try to use query cache. The UpdateTimestampsCache of V1 is never updated (obviously, as it's a read-only view), but I need it to be invalidated when A or B changes.

I can use an interceptor on classes mapped on A and B to invalidate V1 space when something gets inserted, deleted or updated, but it's not really a "general" solution.

There's a better way to do it? Someone on the Hibernate team planned to add the notion of dependency between multiple table/views?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 4:43 am 
Newbie

Joined: Tue Mar 08, 2005 8:00 am
Posts: 10
I'll answer to myself...
A good way is using the <synchronize> tag in the view .hbm file.
Documentation doesn't say it, but it works for cache invalidation too.
Maybe a little addition on 3.1 documentation?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.