<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Second-level caching: Still an effective performance tuning technique</title>
	<atom:link href="http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/</link>
	<description>Blog by a developer for a developer</description>
	<lastBuildDate>Tue, 24 Aug 2010 13:52:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Val</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-14035</link>
		<dc:creator>Val</dc:creator>
		<pubDate>Mon, 05 Oct 2009 18:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-14035</guid>
		<description>Good post...

What will be the best practice with-in seam framework, will L2 cache, Named query help..

&lt;b&gt;Scenario :&lt;/b&gt;
We are sending Ajax request (using suggestionBox) to &lt;b&gt;fetch itemNames when user enters text.&lt;/b&gt;
We have list of approximately 5000 item names, corresponding entity is Item.

What will be the best practice option to get list of itemNames on the basis of text entered in suggestion box by user (we want to query result only for the text entered)

a) Define framework:entity-query in components.xml, call this to fetch itemNames when user enters text.

b) Use built-in ejbql in corresponding itemList.java (default generated by seam) 
@Override
public String getEjbql() {
  return &quot;select item from Item item&quot;;
}

c) Create separate query using enityManager in some bean class, add where clause passing the text entered by user.
public List getItemsList(String itemName) { 
  List itemLst = entityManager.createQuery(&quot;select item from Item item.... where 
      item.itemName=&quot;).getResultList();
  return itemLst;
}</description>
		<content:encoded><![CDATA[<p>Good post&#8230;</p>
<p>What will be the best practice with-in seam framework, will L2 cache, Named query help..</p>
<p><b>Scenario :</b><br />
We are sending Ajax request (using suggestionBox) to <b>fetch itemNames when user enters text.</b><br />
We have list of approximately 5000 item names, corresponding entity is Item.</p>
<p>What will be the best practice option to get list of itemNames on the basis of text entered in suggestion box by user (we want to query result only for the text entered)</p>
<p>a) Define framework:entity-query in components.xml, call this to fetch itemNames when user enters text.</p>
<p>b) Use built-in ejbql in corresponding itemList.java (default generated by seam)<br />
@Override<br />
public String getEjbql() {<br />
  return &#8220;select item from Item item&#8221;;<br />
}</p>
<p>c) Create separate query using enityManager in some bean class, add where clause passing the text entered by user.<br />
public List getItemsList(String itemName) {<br />
  List itemLst = entityManager.createQuery(&#8220;select item from Item item&#8230;. where<br />
      item.itemName=&#8221;).getResultList();<br />
  return itemLst;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TD Ruttenberg</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-13365</link>
		<dc:creator>TD Ruttenberg</dc:creator>
		<pubDate>Wed, 16 Sep 2009 14:44:25 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-13365</guid>
		<description>response to Arbi&#039;s comment:  Even during testing when I am the only one using the app I find the reloading of drop-downs to be majorly annoying.  I have a search page that loads 3 dropdowns all populated by &quot;select distinct&quot; queries.  That&#039;s 3 full table scans per load of the page!  I&#039;m planning to try this technique in my next website release.</description>
		<content:encoded><![CDATA[<p>response to Arbi&#8217;s comment:  Even during testing when I am the only one using the app I find the reloading of drop-downs to be majorly annoying.  I have a search page that loads 3 dropdowns all populated by &#8220;select distinct&#8221; queries.  That&#8217;s 3 full table scans per load of the page!  I&#8217;m planning to try this technique in my next website release.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jacob.orshalick</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-11702</link>
		<dc:creator>jacob.orshalick</dc:creator>
		<pubDate>Fri, 17 Jul 2009 12:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-11702</guid>
		<description>This going to be situation dependent.  Are there any portions of the application that are slow to load (as perceived by the user) even after query tuning?  Are you consistently loading the same data and putting unnecessary load on the database server?  Even with less than 100 users per Seam app I would consider these questions as the database is always the least scalable tier in your application.</description>
		<content:encoded><![CDATA[<p>This going to be situation dependent.  Are there any portions of the application that are slow to load (as perceived by the user) even after query tuning?  Are you consistently loading the same data and putting unnecessary load on the database server?  Even with less than 100 users per Seam app I would consider these questions as the database is always the least scalable tier in your application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arbi Sookazian</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-11639</link>
		<dc:creator>Arbi Sookazian</dc:creator>
		<pubDate>Wed, 15 Jul 2009 20:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-11639</guid>
		<description>I&#039;d like to start using 2nd level cache with EHCache or JBoss Cache but our load (number of users) per app is very low: typically less than 100 users per Seam app.

Is it still worth the effort to design and implement a 2nd level cache for my read-only/read-mostly entities?  We have a 2 node horizontal JBoss AS cluster in prod with state replication turned off.  thx.</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to start using 2nd level cache with EHCache or JBoss Cache but our load (number of users) per app is very low: typically less than 100 users per Seam app.</p>
<p>Is it still worth the effort to design and implement a 2nd level cache for my read-only/read-mostly entities?  We have a 2 node horizontal JBoss AS cluster in prod with state replication turned off.  thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-11046</link>
		<dc:creator>Stephan</dc:creator>
		<pubDate>Tue, 30 Jun 2009 07:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-11046</guid>
		<description>Another advantage of NamedQueries is they will be pre-compiled and validated on deployment. So its easier to find typing errors or logical errors in your queries. In our project we could also monitor an increase of performance, when swapping normal queries out to NamedQueries.</description>
		<content:encoded><![CDATA[<p>Another advantage of NamedQueries is they will be pre-compiled and validated on deployment. So its easier to find typing errors or logical errors in your queries. In our project we could also monitor an increase of performance, when swapping normal queries out to NamedQueries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Links Thread #2 - App Engine, JPA Caching, EJB 3, EJB 3.1, SortedSet</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-11042</link>
		<dc:creator>Links Thread #2 - App Engine, JPA Caching, EJB 3, EJB 3.1, SortedSet</dc:creator>
		<pubDate>Tue, 30 Jun 2009 05:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-11042</guid>
		<description>[...] Second-level caching: Still an effective performance tuning technique (Jacob Orshalick)Sch&#246;ne Einf&#252;hrung in Caching - einmal mit der Seam @Factory Annotation und einmal mit Hibernate Mitteln. [Link] [...]</description>
		<content:encoded><![CDATA[<p>[...] Second-level caching: Still an effective performance tuning technique (Jacob Orshalick)Sch&#246;ne Einf&#252;hrung in Caching &#8211; einmal mit der Seam @Factory Annotation und einmal mit Hibernate Mitteln. [Link] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jacob.orshalick</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-10489</link>
		<dc:creator>jacob.orshalick</dc:creator>
		<pubDate>Thu, 18 Jun 2009 17:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-10489</guid>
		<description>Yes, that is correct, this is a Hibernate-specific feature (i.e. not part of the JPA spec).</description>
		<content:encoded><![CDATA[<p>Yes, that is correct, this is a Hibernate-specific feature (i.e. not part of the JPA spec).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binesh Gummadi</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-10482</link>
		<dc:creator>Binesh Gummadi</dc:creator>
		<pubDate>Thu, 18 Jun 2009 14:10:51 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-10482</guid>
		<description>&lt;blockquote cite=&quot;&quot;&gt;
The @NamedQuery can then be retrieved through the createNamedQuery() method in the EntityManager API.
&lt;/blockquote&gt;

entityManager.createNamedQuery will return Query object from JPA which doesn&#039;t not support setCacheable(true). Since this is a hibernate feature, I believe cacheable queries are possible with hibernate session, correct me if I am wrong.</description>
		<content:encoded><![CDATA[<blockquote cite=""><p>
The @NamedQuery can then be retrieved through the createNamedQuery() method in the EntityManager API.
</p></blockquote>
<p>entityManager.createNamedQuery will return Query object from JPA which doesn&#8217;t not support setCacheable(true). Since this is a hibernate feature, I believe cacheable queries are possible with hibernate session, correct me if I am wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jacob.orshalick</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-7241</link>
		<dc:creator>jacob.orshalick</dc:creator>
		<pubDate>Tue, 07 Apr 2009 18:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-7241</guid>
		<description>You are using ehcache 1.2.3?  I would recommend using a more current version (I&#039;m using 1.4.1 which has a dependency on backport-util-concurrent-3.1.jar as well).  I placed these dependencies in the lib directory of my JBoss server instance.

&lt;blockquote cite=&quot;Dennis Laping&quot;&gt;Is there an ehcache.xml that I need to configure first?&lt;/blockquote&gt;

Yes, you should configure an ehcache.xml.   For Ehcache, this specifies the cache eviction policies I mentioned in the posting.</description>
		<content:encoded><![CDATA[<p>You are using ehcache 1.2.3?  I would recommend using a more current version (I&#8217;m using 1.4.1 which has a dependency on backport-util-concurrent-3.1.jar as well).  I placed these dependencies in the lib directory of my JBoss server instance.</p>
<blockquote cite="Dennis Laping"><p>Is there an ehcache.xml that I need to configure first?</p></blockquote>
<p>Yes, you should configure an ehcache.xml.   For Ehcache, this specifies the cache eviction policies I mentioned in the posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis Laping</title>
		<link>http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/comment-page-1/#comment-7223</link>
		<dc:creator>Dennis Laping</dc:creator>
		<pubDate>Tue, 07 Apr 2009 10:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://solutionsfit.com/blog/2009/04/06/second-level-caching-still-an-effective-performance-tuning-technique/#comment-7223</guid>
		<description>Hello Jacob!
I&#039;m getting a runtime exception after adding the properties in my persistence.xml
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
I&#039;m pretty sure I added the ehcache-1.2.3.jar in the buildpath of my Eclipse IDE. I believe its because of the

Is there an ehcache.xml that I need to configure first?

Thanks in advance,
Dennis</description>
		<content:encoded><![CDATA[<p>Hello Jacob!<br />
I&#8217;m getting a runtime exception after adding the properties in my persistence.xml<br />
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException<br />
I&#8217;m pretty sure I added the ehcache-1.2.3.jar in the buildpath of my Eclipse IDE. I believe its because of the</p>
<p>Is there an ehcache.xml that I need to configure first?</p>
<p>Thanks in advance,<br />
Dennis</p>
]]></content:encoded>
	</item>
</channel>
</rss>
