<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technotrance, Illusions and Perspectives &#187; java-internals</title>
	<atom:link href="http://myblog.shriharisc.com/category/java-internal/feed/" rel="self" type="application/rss+xml" />
	<link>http://myblog.shriharisc.com</link>
	<description>A dose of everyday bruises with Java/JEE</description>
	<lastBuildDate>Mon, 02 Aug 2010 17:45:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Quick note about Hibernate Caching</title>
		<link>http://myblog.shriharisc.com/2009/09/14/a-quick-note-about-hibernate-caching/</link>
		<comments>http://myblog.shriharisc.com/2009/09/14/a-quick-note-about-hibernate-caching/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 16:32:43 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[java-internals]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[query-cache]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=111</guid>
		<description><![CDATA[1)    First Level Cache (Transaction Layer)
a) Associated with a Hibernate Session (transaction scoped) and this cache is used by Hibernate transparently. Hibernate requires a key to load object from the session cache. Hence its better to call a load() or get(), when the key(EntityKey) is known, rather than using a HQL query.
b) All queries (state [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-right:0;text-align:left;" dir="ltr"><span style="text-decoration:underline;"><strong><em>1)    First Level Cache (Transaction Layer)</em></strong></span></p>
<p style="margin-right:0;text-align:left;" dir="ltr">a) Associated with a Hibernate Session (transaction scoped) and this cache is used by Hibernate transparently. Hibernate requires a key to load object from the session cache. Hence its better to call a load() or get(), when the key(EntityKey) is known, rather than using a HQL query.<br />
b) All queries (state of an entity, updates) in the cache gets flushed / committed to the database only when  Transaction context ends (i.e.) <strong>getTransaction().commit</strong> is called.<br />
c) Always used and cannot be turned off.</p>
<p style="margin-right:0;text-align:left;" dir="ltr"><span style="text-decoration:underline;"><strong><em>2)    Second Level Cache (Application Layer)</em></strong></span></p>
<p style="margin-right:0;text-align:left;" dir="ltr">a) Associated with a Hibernate&#8217;s SessionFactory (process scoped). Enabled by default in Hibernate 3 and uses <strong>EHCache</strong> as default cache provider.<br />
b) The cache entries are dehydrated states of entity objects. A dehydrated state of entity refers to a key­-value  pair where key is the entity id (of the dehydrated entity) and the set of (deep copy) of attribute­values  (dehydrated entity fields) refer to the value.  Hibernate does not cache associations in a dehydrated object by default. One has to manually configured which association in a dehydratable entity to be cached.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">Syntax : { id ­&gt; { atribute1, attribute2, attribute3,{attribute41, attribute42},&#8230; } }</p>
<p style="margin-right:0;text-align:left;" dir="ltr"><span style="text-decoration:underline;"><strong><em>3)   Query cache (</em></strong><strong>org.hibernate.cache.QueryCache)</strong></span></p>
<p style="margin-right:0;text-align:left;" dir="ltr">a) Defines 2 cache regions : <strong>org.hibernate.cache.StandardQueryCache</strong> (stores query with parameters as cache key) and <strong>org.hibernate.cache.UpdateTimestampsCache</strong> (keeps stale query results of last results fetch). Both the cache regions are evicted when the entity related to the cacheable query is updated.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">Syntax : { query,{parameters}} &#8212;&gt; {id of cached entity}</p>
<p style="margin-right:0;text-align:left;" dir="ltr">b) A specific query results are cached, by specifying setCacheable(true) on Session&#8217;s Query handle.</p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;">
<p style="margin-right:0;text-align:left;" dir="ltr"><em>1)    First Level Cache (Transaction Layer)</em></p>
<p style="margin-right:0;text-align:left;" dir="ltr">a) Associated with a Hibernate Session (transaction scoped) and this cache is used by Hibernate transparently. Hibernate requires a key to load object from the session cache. Hence its better to call a load() or get(), when the key(EntityKey) is known, rather than using a HQL query.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">b) All queries (state of an entity, updates) in the cache gets flushed / committed to the database only when  Transaction context ends (i.e.) <strong>getTransaction().commit</strong> is called.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">c) Always used and cannot be turned off.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">
<p style="margin-right:0;text-align:left;" dir="ltr"><em>2)    Second Level Cache (Application Layer)</em></p>
<p style="margin-right:0;text-align:left;" dir="ltr">a) Associated with a Hibernate&#8217;s SessionFactory (process scoped). Enabled by default in Hibernate 3 and uses <strong>EHCache</strong> as default cache provider.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">
<p style="margin-right:0;text-align:left;" dir="ltr">b) The cache entries are dehydrated states of entity objects. A dehydrated state of entity refers to a key­-value  pair where key is the entity id (of the dehydrated entity) and the set of (deep copy) of attribute­values  (dehydrated entity fields) refer to the value.  Hibernate does not cache associations in a dehydrated object by default. One has to manually configured which association in a dehydratable entity to be cached.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">
<p style="margin-right:0;text-align:left;" dir="ltr">Syntax : { id ­&gt; { atribute1, attribute2, attribute3,{attribute41, attribute42},&#8230; } }</p>
<p style="margin-right:0;text-align:left;" dir="ltr">
<p style="margin-right:0;text-align:left;" dir="ltr"><em>3)   Query cache (</em><strong>org.hibernate.cache.QueryCache</strong>)</p>
<p style="margin-right:0;text-align:left;" dir="ltr">
<p style="margin-right:0;text-align:left;" dir="ltr">a) Defines 2 cache regions : <strong>org.hibernate.cache.StandardQueryCache</strong> (stores query with parameters as cache key) and <strong>org.hibernate.cache.UpdateTimestampsCache</strong> (keeps stale query results of last results fetch). Both the cache regions are evicted when the entity related to the cacheable query is updated.</p>
<p style="margin-right:0;text-align:left;" dir="ltr">Syntax : { query,{parameters}} &#8212;&gt; {id of cached entity}</p>
<p style="margin-right:0;text-align:left;" dir="ltr">b) A specific query results are cached, by specifying setCacheable(true) on session&#8217;s Query handle.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/09/14/a-quick-note-about-hibernate-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Code Search Engines</title>
		<link>http://myblog.shriharisc.com/2009/07/29/cool-code-search-engines/</link>
		<comments>http://myblog.shriharisc.com/2009/07/29/cool-code-search-engines/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 10:12:40 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[java-internals]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=81</guid>
		<description><![CDATA[Stumbled on some of the cool code search engines for instant source code reference. Here are few:
1) http://codesearch.google.com &#8211; Code hosted on Google Code
2) http://grepcode.com &#8211; Maven repository based code search.
3) http://koders.com &#8211; Multi programming lingual search.
4) http://www.krugle.org/kse/ &#8211; Another language based search
5) http://www.ucodit.com &#8211; Neat organization of categories of code retreived.
6) http://www.codase.com/ &#8211; Another [...]]]></description>
			<content:encoded><![CDATA[<p>Stumbled on some of the cool code search engines for instant source code reference. Here are few:</p>
<p>1) http://codesearch.google.com &#8211; Code hosted on <a href="http://code.google.com/hosting/">Google Code</a></p>
<p>2) http://grepcode.com &#8211; Maven repository based code search.</p>
<p>3) http://koders.com &#8211; Multi programming lingual search.</p>
<p>4) http://www.krugle.org/kse/ &#8211; Another language based search</p>
<p>5) http://www.ucodit.com &#8211; Neat organization of categories of code retreived.</p>
<p>6) http://www.codase.com/ &#8211; Another language based search offering category specific retreival.</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/07/29/cool-code-search-engines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling plain clustering on JBoss in 3 steps</title>
		<link>http://myblog.shriharisc.com/2009/07/13/enabling-plain-clustering-on-jboss-in-3-steps/</link>
		<comments>http://myblog.shriharisc.com/2009/07/13/enabling-plain-clustering-on-jboss-in-3-steps/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 16:40:27 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[java-internals]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=69</guid>
		<description><![CDATA[This quick tip tells about enabling clustering on a existing non-all JBoss realm($JBOSS_HOME/server/all), say default realm ($JBOSS_HOME/server/default) (by default clustering with farming (hot-deployment) in enabled for &#8216;all&#8217; realm).
1) Synchronize(copy) the lib/*.jar from all to the custom realm (eg. default)
2) Copy the cluster-service.xml  from &#8216;all&#8217; to your custom realm and retain the mbean with code org.jboss.ha.framework.server.ClusterPartition, [...]]]></description>
			<content:encoded><![CDATA[<p>This quick tip tells about enabling clustering on a existing non-all JBoss realm($JBOSS_HOME/server/all), say default realm ($JBOSS_HOME/server/default) (by default clustering with farming (hot-deployment) in enabled for &#8216;all&#8217; realm).</p>
<p>1) Synchronize(copy) the lib/*.jar from all to the custom realm (eg. default)<br />
2) Copy the cluster-service.xml  from &#8216;all&#8217; to your custom realm and retain the mbean with code <strong>org.jboss.ha.framework.server.ClusterPartition,</strong> removing the other beans, as they are need for advanced configuration.Be-default, the discovery of the other nodes in the partition is identified by UDP configuration specified by <strong>PartitionConfig</strong> tag.<br />
3) Copy the farm-service.xml from all/deploy.last to your custom realm directory.</p>
<p>Repeat these steps on all cluster instances.</p>
<p>Run the JBoss cluster server instances using</p>
<pre><em>run -c [realm_id] -b 0.0.0.0</em></pre>
<p>Note: If your cluster instance binds to localhost/127.0.0.1, you could bind to your actual IP<em><br />
</em></p>
<pre><em>run -c [realm_id] -b x.x.x.x
</em></pre>
<p>You could read more at<em> <a href="http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html">JBoss Clustering chapter</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/07/13/enabling-plain-clustering-on-jboss-in-3-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
