<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 29 Sep 2009, at 09:57, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>Again, this is a feature from Coherence[1].</div><div><br></div><div>Basic idea is to execute a query against the cache, and hold the result object. This result object will always have up to date query result; this means that whenever something is modified in the cache the result itself is updated. Advantage: if one performs the same query very often(e.g.&nbsp;several times every millisecond) the response will be fast and the system will not be overloaded.&nbsp;</div></div></blockquote><div><br></div><div>Is it really faster? &nbsp;Surely all you save is the construction of the various query objects, but the query itself would have to be re-run every time. &nbsp;Or does it attach a listener to the cache and check whether any new additions/removals should be used to update the result set? &nbsp;I don't see how that could be much faster though.</div><div><br></div><div>Adding Hibernate-dev in cc so that the HIbernate Search guys can comment too.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>E.g.&nbsp;</div><div><pre xml:space="preserve" class="oac_no_warn">Filter filter = new AndFilter(new EqualsFilter("getTrader", traderid),
                              new EqualsFilter("getStatus", Status.OPEN));</pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn">ContinuousQueryCache cacheOpenTrades = new ContinuousQueryCache(cache, filter);</pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn">Iterator iter = cacheOpenTrades.entrySet().iterator(); //*this entrySet call will be instant!*</pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">FOr a full list of scenario in which this can be used take a look at [1].</pre><pre xml:space="preserve" class="oac_no_warn">Shall we consider adding something similar?</pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">Cheers,</pre><pre xml:space="preserve" class="oac_no_warn">Mircea</pre></pre></pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></span></font></pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">[1] <a href="http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/continuousquery.htm#BABBEIAH">http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/continuousquery.htm#BABBEIAH</a></pre></pre></pre></div></div>_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>