Hi, again<br><br>Thanks for the reply, Joe. I've checked out the event system and could not find anything helpful. It seems that the generated events are only fired after the cache is invalidated.<br><br>I've found a way to do this implementing a QueryCache, but it's not the most elegant solution. I verify the query to be retrieved from the cache via the toString() method in the QueryKey object. If the SQL matches the one I'm trying to turn stale cache tolerant, I ignore the timestamp.<br>
<br>Is there a better way to do this, to look at the query being passed? Wouldn't it be nice to have a getter for it in the QueryKey class?<br><br>Thanks<br clear="all"><br>--<br>Luiz F. O. Corte Real<br><br>Vida Geek<br>
<a href="http://vidageek.net" target="_blank">http://vidageek.net</a><br><br>Caelum | Ensino e Inovação<br><a href="http://www.caelum.com.br" target="_blank">http://www.caelum.com.br</a><br>
<br><br><div class="gmail_quote">On Thu, Mar 24, 2011 at 12:16 PM, Haswell, Joe <span dir="ltr"><<a href="mailto:josiah.d.haswell@hp.com">josiah.d.haswell@hp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I’d check out the event system. If a particular event invalidates your cache, just clear it or the region of it that’s invalid.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Joe H. | HP Software</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:hibernate-users-bounces@lists.jboss.org" target="_blank">hibernate-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:hibernate-users-bounces@lists.jboss.org" target="_blank">hibernate-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Luiz Fernando O. C. Real<br>
<b>Sent:</b> Thursday, March 24, 2011 9:06 AM<br><b>To:</b> hibernate-users<br><b>Subject:</b> [hibernate-users] Stale query cache by column</span></p></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal">
Hi,<br><br>I'm trying to implement a custom QueryCache that, like the example in <a href="http://community.jboss.org/wiki/QueryCache" target="_blank">http://community.jboss.org/wiki/QueryCache</a>, does not invalidate some existing register is updated in a specific table. However, unlike the example, I'd like to do that by analyzing which columns were changed in an update.<br>
<br>More precisely, I have an User table, which has a lastLogin column. I'd like to keep the QueryCache valid when I update the lastLogin of an User.<br><br>I haven't found any way to do that yet. Is that possible?<br>
<br>Thanks in advance.<br clear="all"><br>--<br>Luiz F. O. Corte Real<br><br>Vida Geek<br><a href="http://vidageek.net/" target="_blank">http://vidageek.net</a><br><br>Caelum Objects<br><a href="http://www.caelumobjects.com/" target="_blank">http://www.caelumobjects.com</a> </p>
</div></div></div></div></blockquote></div><br>