<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Thoughts...</title>
	<atom:link href="http://vmchellappan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vmchellappan.wordpress.com</link>
	<description>Just another weblog</description>
	<lastBuildDate>Mon, 08 Mar 2010 12:11:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vmchellappan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Thoughts...</title>
		<link>http://vmchellappan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vmchellappan.wordpress.com/osd.xml" title="Thoughts..." />
	<atom:link rel='hub' href='http://vmchellappan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Spring Security &#8211; JBOSS Compatability Issue</title>
		<link>http://vmchellappan.wordpress.com/2010/03/08/spring-security-jboss-compatability-issue/</link>
		<comments>http://vmchellappan.wordpress.com/2010/03/08/spring-security-jboss-compatability-issue/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 12:08:56 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBOSS Server]]></category>
		<category><![CDATA[JBOSS Weird Issues]]></category>
		<category><![CDATA[Security Implementation]]></category>
		<category><![CDATA[Spring Secutiry Implementation]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=41</guid>
		<description><![CDATA[I have been working on a project which uses Spring 3.0 for all middle tier activities and JBOSS App. Server for deployment. In that, we encountered a weird issue while using Spring&#8217;s Security Implementation, everything works fine in the customer &#8230; <a href="http://vmchellappan.wordpress.com/2010/03/08/spring-security-jboss-compatability-issue/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=41&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been working on a project which uses Spring 3.0 for all middle tier activities and JBOSS App. Server for deployment. In that, we encountered a weird issue while using Spring&#8217;s Security Implementation, everything works fine in the customer end where as in vendor place the site was not at all working if we include this security implementation, when we remove that and launch the application everything works fine. Since this is a intranet web app and used only for testing a huge data transfer we revoked the security implementation in vendor end and they were doing their job without any issue. </p>
<p>Last week when myself and on-site person decided to work on this to find out at the root cause of this issue. After around 4 hrs of head ache, we found that the entire issue was due to JBOSS Server, both of us are using 5.0 GA Release but the only difference vendor launched it in a Community edition (open source) where as customer launch from Enterprise edition. As soon as we change the server, everything works fine in both end.</p>
<p>I found this a weird issue from JBOSS. No where in JBOSS site, it has been mentioned that community and enterprise edition has different implementation and even the error message JBOSS throws doesn&#8217;t say anything about these things, instead it states some error in Spring&#8217;s Security XSD Schema. From this, we learn a lesson that whenever a tested piece of code doesn&#8217;t work on other end always check the entire software list used on the other end w.r.t every minute detail and then look into your deployment steps. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=41&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2010/03/08/spring-security-jboss-compatability-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
		<item>
		<title>Value Round off in MYSQL&#8230;</title>
		<link>http://vmchellappan.wordpress.com/2009/10/09/value-round-off-in-mysql/</link>
		<comments>http://vmchellappan.wordpress.com/2009/10/09/value-round-off-in-mysql/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 04:30:11 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[BIGINT]]></category>
		<category><![CDATA[Datatype Issue]]></category>
		<category><![CDATA[INT]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Round-off Problem]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=36</guid>
		<description><![CDATA[For years, I have been working with number of SQL Databases where if u pass a value to a column which is more than what it can hold. Then, all we expect is to throw an SQL error message.. But &#8230; <a href="http://vmchellappan.wordpress.com/2009/10/09/value-round-off-in-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=36&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For years, I have been working with number of SQL Databases where if u pass a value to a column which is more than what it can hold. Then, all we expect is to throw an SQL error message..</p>
<p>But this seem to break in MYSQL. I mistakenly created a session_id column with integer and passed System.currentTimeMillis() as its value. Whatever the value from time in milli secs call, session_id always will always this one value &#8220;2147483647&#8243;. I debugged my code for hours to check where this conversion happens and found it is not happening there. </p>
<p>Suddenly, I remembered that db column is of int datatype and System.currentTimeMillis() will return a long which could be the source of problem. Hence, I changed the column datatype to BIGINT, everything started working fine. After some exploration, I found that when a int column value exceeds it acceptable limit MYSQL will downcast the value to max possible allowed. I don&#8217;t know why it has been designed this way but whatever the reason is I call this as a strange behavior when compared to other databases. </p>
<p>If I got an SQL error or at least warning in the beginning, the mistake would have been corrected in the first call itself and saved hell a lot of time. Hope others will remember the issue when working with MYSQL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=36&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2009/10/09/value-round-off-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
		<item>
		<title>Casesensitive Issue in MYSQL</title>
		<link>http://vmchellappan.wordpress.com/2009/07/28/casesensitive-issue-in-mysql/</link>
		<comments>http://vmchellappan.wordpress.com/2009/07/28/casesensitive-issue-in-mysql/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 10:36:08 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Case Sensitive]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=32</guid>
		<description><![CDATA[I bumped into a weird issue that my java web application is working perfectly in Windows box where as when I deploy that in linux it throws following error &#8220;dbuser1.table1&#8243; doesn&#8217;t exist. After scratching our head for couple of hours &#8230; <a href="http://vmchellappan.wordpress.com/2009/07/28/casesensitive-issue-in-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=32&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I bumped into a weird issue that my java web application is working perfectly in Windows box where as when I deploy that in linux it throws following error &#8220;dbuser1.table1&#8243; doesn&#8217;t exist. </p>
<p>After scratching our head for couple of hours I found that I created table with name as &#8220;Table1&#8243; in Mysql database where as in the code I called it as &#8220;table1&#8243; and that&#8217;s the problem. The weird thing is that it everything works fine if the database is deployed in Windows and all this problem will arise only with Linux.</p>
<p>After that I changed the code to access the table with proper name everything works fine. As I used this table name in more than one place it took more than 30 mins to search and replace all entries. So, whenever you have a possibility of linux deployment make sure you use a DBObjectConstants class for holding all database related object names and use that constant through out your application. In this way fixing these kind of issues will be more easier.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=32&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2009/07/28/casesensitive-issue-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
		<item>
		<title>Nationalized Bank Norms</title>
		<link>http://vmchellappan.wordpress.com/2009/04/28/nationalised-bank-norms/</link>
		<comments>http://vmchellappan.wordpress.com/2009/04/28/nationalised-bank-norms/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 17:01:54 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Akshaya Trithi]]></category>
		<category><![CDATA[Bank Norms]]></category>
		<category><![CDATA[Bank Procdures]]></category>
		<category><![CDATA[Nationalized bank]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=22</guid>
		<description><![CDATA[Last week I thought of buying gold coins for Akshaya Trithy. I spoke to a private bank and nationalized bank through phone about their pricing and found that its almost 500Rs lesser in nationalized bank due to various reasons. So, &#8230; <a href="http://vmchellappan.wordpress.com/2009/04/28/nationalised-bank-norms/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=22&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I thought of buying gold coins for Akshaya Trithy. I spoke to a private bank and nationalized bank through phone about their pricing and found that its almost 500Rs lesser in nationalized bank due to various reasons. So, I decided to purchase from them and went to one of their branch around 3 PM, that&#8217;s where the shock came to me about their ridiculous procedures. </p>
<p>1. There is no one available in reception to guide me where I can find details.<br />
2. After I found the appropriate section, the person in charge told they wont sell to credit card. How strange, I believe they still do business in 1970&#8242;s.<br />
3. Now, the funniest part &#8211; I asked him whether I can purchase it by cash, for that he told bank official hours closed by 2 PM. So, he can&#8217;t help that way too.<br />
4. Finally he said cheque would be ok but I should have account in his bank <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Isn&#8217;t it stupid? </p>
<p>Only good thing through out the discussion is that the person who explained all this to me is very polite in his replies and I believes he itself laughs inside on this stupid rules.</p>
<p>Finally, I&#8217;m forced to purchase from private bank and incur loss of 500+ Rs. I damn sure this would have happened to at least 100+ persons like me. Lets assume if they all purchase an average of 5 gms, then bank would have made a sale of around Rs.8L. From consumer point of view each of us might have saved 500 Rs there by 50k in total. I don&#8217;t know when the top mgmt of nationalized banks understand this and make appropriate changes in their norms to increase additional revenue. This would also make private banks to reduce their rates to become more competitive&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=22&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2009/04/28/nationalised-bank-norms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
		<item>
		<title>Commonsense Prevailed</title>
		<link>http://vmchellappan.wordpress.com/2009/03/28/commonsense-prevailed/</link>
		<comments>http://vmchellappan.wordpress.com/2009/03/28/commonsense-prevailed/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 08:35:59 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Article writer]]></category>
		<category><![CDATA[IPL 2009]]></category>
		<category><![CDATA[Media]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=17</guid>
		<description><![CDATA[Everyone in India know what was the talking point for last 2 weeks. <B>IPL</B>, Should it happen in India or not. Almost all the papers and news channels had a coverage on this during their prime time. At times, they gone overboard too.  <a href="http://vmchellappan.wordpress.com/2009/03/28/commonsense-prevailed/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=17&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Everyone in India know what was the talking point for last 2 weeks. <B>IPL</B>, Should it happen in India or not. Almost all the papers and news channels had a coverage on this during their prime time. At times, they gone overboard too. During this period, I read an article in one of the leading English daily which is just upto the point. Its written in a manner that no one can feel offensive about it. The message it conveyed was &#8220;IPL Should be either played later or Out of the country, It should not be allowed to clash with the General Elections, As it is the top priority for the country&#8221;. I read some other articles too that conveyed the same message but they unnecessarily try to tarnish the image of few individuals linked with IPL. We all know there is nothing called &#8220;Free Lunch&#8221; in this world, then why unnecessarily pointing fingers to IPL stating they care only about Money and all. Why don&#8217;t we understand that IPL is a business run by entrepreneurs, all they look for is balance sheet at the end of the year to view its profit/loss. If they don&#8217;t do that, other stake holders will hold them responsible for all the mishandling. For them, staging IPL is much more important than anything else. This is pure commonsense, I don&#8217;t understand why most of the article writers or chatters in talk show don&#8217;t understand this&#8230; </p>
<p>I had a feeling right from the beginning of this episode that IPL will not be staged in April-May because government was pretty clear on its message that it cannot share para military forces for security because of general elections. So, all this unnecessary barking has just increased the ratings for prime time shows rather than anything else.</p>
<p>I felt really happy that at least one writer&#8217;s Commonsense has prevailed and kept his writing just to the point and not to anything else.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=17&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2009/03/28/commonsense-prevailed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
		<item>
		<title>String Concatenation</title>
		<link>http://vmchellappan.wordpress.com/2009/03/19/string-concatenation/</link>
		<comments>http://vmchellappan.wordpress.com/2009/03/19/string-concatenation/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 08:37:35 +0000</pubDate>
		<dc:creator>MuthuChellappan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Concat Issues]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[StringBuffer]]></category>
		<category><![CDATA[StringBuilder]]></category>

		<guid isPermaLink="false">http://vmchellappan.wordpress.com/?p=3</guid>
		<description><![CDATA[How many times you heard reviewer saying that stringbuffer should be used for all string Concatenations. I did this everytime when I use to review others code because I feel that will improve performance. Couple of weeks back I read &#8230; <a href="http://vmchellappan.wordpress.com/2009/03/19/string-concatenation/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=3&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How many times you heard reviewer saying that stringbuffer should be used for all string Concatenations. I did this everytime when I use to review others code because I feel that will improve performance. Couple of weeks back I read an article which totally changed my thought on this, I never believed what it said initially but I tested that by myself and found thats really true..</p>
<p>Lets take this example</p>
<blockquote><p>
Code 1<br />
String a = &#8220;Test Concat&#8221; + &#8220;Test Concat&#8221; + &#8220;Test Concat&#8221; + &#8220;Test Concat&#8221; ;
</p></blockquote>
<p>When somebody reviews this code they will say it should be change like this</p>
<blockquote><p>Code 2<br />
<code>StringBuffer buf = new StringBuffer(50);<br />
buf.append("Test&nbsp;Concat").append("Test&nbsp;Concat").append("Test&nbsp;Concat").append("Test&nbsp;Concat");</code></p></blockquote>
<p>Because, this will redunce the no. of internal string object creations and that is quite true.. However, today&#8217;s Compilers are really smart they will internally change the line mentioned in code 1 to code 2 during execution. So, even if the developer does this mistake it will be corrected by the Compiler.</p>
<p>Only place where <strong>Compiler will fail </strong>to this, if the Concatenation happens in <strong>loops </strong>like this</p>
<blockquote><p>Code 3<br />
<code>long stTime = System.currentTimeMillis();<br />
String str = "";<br />
for (int i=0; i&lt;5000; i++){<br />
 str = str + " Test&nbsp;Concat";<br />
}<br />
System.out.println("Time taken --&gt;" + (System.currentTimeMillis() - stTime) +  " loop concat " + str);</code></p></blockquote>
<p>Here &#8216;n&#8217; no of internal string objects will get created and then appended to the base string. Hence this piece of code must get changed to</p>
<blockquote><p>
<code><br />
Code 4<br />
stTime = System.currentTimeMillis();<br />
StringBuffer strBuf = new StringBuffer(10000);<br />
for (int i=0; i&lt;5000; i++){<br />
 strBuf.append(" Test&nbsp;Concat");<br />
}<br />
System.out.println("Time taken --&gt;" + (System.currentTimeMillis() - stTime) +  " loop append" + strBuf.toString());</code></p></blockquote>
<p>This will significantly improve the performace&#8230; This is what the time it took on my local machine</p>
<p>For Loop value 5000<br />
Code 3 : Time taken &#8211;&gt;594 ms<br />
Code 4 : Time taken &#8211;&gt;0 ms</p>
<p>For Loop Value 10000<br />
Code 3 : Time taken &#8211;&gt;3266 ms<br />
Code 4 : Time taken &#8211;&gt;15 ms</p>
<p>Points to remember:<br />
1. Whenever there is a string conactnation in loops change that to Stringbuffer/StringBuilder, because here it will improve performance<br />
2. Always write String Concatenation code using StringBuffer or StringBuilder classes, because they fall into good coding practices and we are not depending on Compiler&#8217;s Intelligence level to cover up our mistakes&#8230;<br />
3. Being said that, there is no point taking up a excercise of clearing all general String Concatenations done so far in 10000 line code base maintanence project and changing that to Stringbuffer. This will not add any major improvement to your performance issues. This can be taken as a excercise but not a high priority one as some might think.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vmchellappan.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vmchellappan.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vmchellappan.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vmchellappan.wordpress.com&amp;blog=6913326&amp;post=3&amp;subd=vmchellappan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vmchellappan.wordpress.com/2009/03/19/string-concatenation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9d8abb8b3a3ea6240da6d7e3fb373c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vmchellappan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
