<?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>Helena Edelson</title>
	<atom:link href="http://edelsonmedia.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://edelsonmedia.com</link>
	<description>Enterprise &#38; Cloud Messaging &#124; Spring &#124; AMQP &#124; RabbitMQ &#124; Esper &#124; CEP &#124; CloudOps &#124; Management &#38; Monitoring &#124; Security</description>
	<lastBuildDate>Wed, 25 Aug 2010 14:39:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RabbitMQ 2.0.0 Released</title>
		<link>http://edelsonmedia.com/?p=562#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=562#comments</comments>
		<pubDate>Wed, 25 Aug 2010 14:37:23 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[AMQP]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Hyperic]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[RabbitMQ]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=562</guid>
		<description><![CDATA[More details here. 
Release posts are about all I have time for these days&#8230;been heads down for a month getting an amqp/rabbitmq thing ready for release.

    
]]></description>
			<content:encoded><![CDATA[<p><a href="http://lists.rabbitmq.com/pipermail/rabbitmq-announce/2010-August/000028.html" target="_new" title="rabbitmq 2.0.0 is out">More details here</a>. </p>
<p>Release posts are about all I have time for these days&#8230;been heads down for a month getting an amqp/rabbitmq thing ready for release.
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=RabbitMQ%202.0.0%20Released&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D562"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=562</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 3.0.4 is now available</title>
		<link>http://edelsonmedia.com/?p=557#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=557#comments</comments>
		<pubDate>Sat, 21 Aug 2010 14:39:23 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=557</guid>
		<description><![CDATA[Spring 3.0.4 is now available: vew Arjen&#8217;s post

    
]]></description>
			<content:encoded><![CDATA[<p>Spring 3.0.4 is now available: vew <a href="http://www.springsource.org/node/2740">Arjen&#8217;s post</a>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%203.0.4%20is%20now%20available&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D557"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=557</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Integration 2.0 M6 Released</title>
		<link>http://edelsonmedia.com/?p=552#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=552#comments</comments>
		<pubDate>Mon, 02 Aug 2010 16:27:59 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=552</guid>
		<description><![CDATA[The Maven central style artifacts are available in maven.springframework.org/milestone:
https://s3browse.springsource.com/browse/maven.springframework.org/milestone/org/springframework/integration/

    
]]></description>
			<content:encoded><![CDATA[<p>The Maven central style artifacts are available in maven.springframework.org/milestone:</p>
<p><a href="https://s3browse.springsource.com/browse/maven.springframework.org/milestone/org/springframework/integration/">https://s3browse.springsource.com/browse/maven.springframework.org/milestone/org/springframework/integration/</a>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20Integration%202.0%20M6%20Released&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D552"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=552</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RabbitMQ and Erlang Intallation for Mac OSX</title>
		<link>http://edelsonmedia.com/?p=523#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=523#comments</comments>
		<pubDate>Fri, 11 Jun 2010 23:24:11 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[RabbitMQ]]></category>
		<category><![CDATA[Spring ROO]]></category>
		<category><![CDATA[RabbitMQ Server]]></category>
		<category><![CDATA[ROO]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=523</guid>
		<description><![CDATA[I&#8217;ve been a linux developer for years so I was all thumbs having to look up everything when setting up a new dev environment on a mac. Here&#8217;s some tips for setting up a local RabbitMQ server to play with (i.e. not using macports locally, not the EC2 install etc):
Install and build Erlang
First, Check for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a linux developer for years so I was all thumbs having to look up everything when setting up a new dev environment on a mac. Here&#8217;s some tips for setting up a local RabbitMQ server to play with (i.e. not using macports locally, not the EC2 install etc):</p>
<h3>Install and build Erlang</h3>
<p>First, Check for the <a href=" http://www.erlang.org/download.html#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">latest Erlang GA Release</a> and note the version.</p>
<ol>
<li>cd to the dir you wish to install into</li>
<li>wget http://erlang.org/download/otp_src_{version}.tar.gz</li>
<li>tar xzvf otp_src_{version}.tar.gz</li>
<li>cd otp_src_{version}</li>
<li>NOTE: run ./configure &#8211;help to see what opts you want to run with</li>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
<li>cd ../</li>
</ol>
<h3>Install RabbitMQ Server</h3>
<p>First check the <a href="http://www.rabbitmq.com/server.html" target="_blank">latest version of RabbitMQ Server</a> and note the filename.</p>
<ol>
<li>wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.7.2/rabbitmq-server-generic-unix-1.7.2.tar.gz</li>
<li>tar xzvf rabbitmq-server-generic-unix-1.7.2.tar.gz</li>
<li>Complete the install and config from <a href="http://www.rabbitmq.com/install.html#generic-unix" target="_blank">http://www.rabbitmq.com/install.html#generic-unix</a>, making sure the logs, clustering, data and config dirs are set up</li>
<li>Start RabbitMQ: run rabbit../sbin/rabbitmq-server</li>
</ol>
<h3>If you need a few things first</h3>
<ol>
<li>First, if you don&#8217;t have it, download <a href="http://developer.apple.com/technologies/xcode.html" target="_blank">Apple XCode</a> so you can compile Erlang with gcc. FYI the XCode download could not take longer, start it and go build an enterprise app in ROO, deploy it to the cloud, and when you&#8217;re done it may have completed. If I knew more about it I&#8217;d just download the particular compiler needed which is some form of C compiler. If I find out I&#8217;ll update this for a simpler install. if you know, send me a tweet: @hollyedelson</li>
<li>While that&#8217;s downloading, if you don&#8217;t have it, get the latest version of wget from <a href="http://ftp.gnu.org/pub/gnu/wget" target="_blank">http://ftp.gnu.org/pub/gnu/wget</a></li>
<li>On the command line:
<ol>
<li>tar -xzf wget-{version}.tar.gz</li>
<li>cd wget{version}</li>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ol>
</li>
<li>Now run the steps from Version A above.</li>
</ol>
<h3>Find Out More</h3>
<p><a href="http://www.rabbitmq.com" target="_blank">rabbitmq.com</a> <a href="http://www.erlang.org/" target="_blank">erlang.org</a>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=RabbitMQ%20and%20Erlang%20Intallation%20for%20Mac%20OSX&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D523"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=523</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JMX and MBean Support With Spring</title>
		<link>http://edelsonmedia.com/?p=542#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=542#comments</comments>
		<pubDate>Mon, 17 May 2010 20:21:05 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring JMX]]></category>
		<category><![CDATA[@ManagedAttribute]]></category>
		<category><![CDATA[@ManagedOperation]]></category>
		<category><![CDATA[@ManagedResource]]></category>
		<category><![CDATA[JMX]]></category>
		<category><![CDATA[MBean]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=542</guid>
		<description><![CDATA[The context of this post is simply about how to use the Spring Framework to export your Spring-managed pojos for management and monitoring via JMX. Later I&#8217;ll post on using Hyperic, in the cloud, etc. First things first &#8211; as this is an update from a similar post of mine from &#8216;08 or early &#8216;09.
Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The context of this post is simply about how to use the Spring Framework to export your Spring-managed pojos for management and monitoring via JMX. Later I&#8217;ll post on using Hyperic, in the cloud, etc. First things first &#8211; as this is an update from a similar post of mine from &#8216;08 or early &#8216;09.</p>
<p>Let&#8217;s start by adding the spring jmx dependency, which will be something like this, depending on the repos you are using:</p>
<p>&lt;dependency&gt;<br />
&lt;groupId&gt;org.springframework&lt;/groupId&gt;<br />
&lt;artifactId&gt;org.springframework.core&lt;/artifactId&gt;<br />
&lt;version&gt;${spring.framework.version}&lt;/version&gt;<br />
&lt;/dependency&gt;</p>
<h3>Service Pojo</h3>
<p>Now let&#8217;s set up some java classes for management. I have a business service that I want to monitor and a pojo to instrument.</p>
<pre class="brush: java" style="font-size: 120%;">@BusinessService
@ManagedResource(objectName = "bean:name=inventoryManager", description = "Inventory Service",
        log = true, logFile = "oms.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200,
        persistLocation = "foo", persistName = "bar")
public class InventoryServiceImpl implements InventoryService {

    @Autowired private InventoryDao inventoryDao;

    @ManagedOperation(description = "Add two numbers")
    @ManagedOperationParameters({
            @ManagedOperationParameter(name = "x", description = "The first number"),
            @ManagedOperationParameter(name = "y", description = "The second number")})
    public int add(int x, int y) {
        return x + y;
    }

    @ManagedOperation(description = "Get inventory levels")
    @ManagedOperationParameters({@ManagedOperationParameter(name = "product", description = "The Product)})
    public long getInventoryLevel(Product product) {
        return getInventoryLevel(product.getSkew());
    }
}</pre>
<p>First, let&#8217;s peak into my @BusinessService annotation in case you are wondering:</p>
<pre class="brush: java" style="font-size: 120%;">@Transactional
@Service
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface BusinessService {
}</pre>
<p>Annotating any of my service layer pojo&#8217;s makes them both transactional and with an instance created in the Spring context.</p>
<h3>Entity Pojo</h3>
<p>Now here is a simple pojo as an entity or javabean, what have you:</p>
<pre class="brush: java" style="font-size: 120%;">@ManagedResource(objectName = "bean:name=myPojoEntity", description = "My Managed Bean", log = true,
        logFile = "oms.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200,
        persistLocation = "foo", persistName = "bar")
public class MyPojo {

    private long somethingToTuneInRuntime;

    /* Creates a writeable attribute for managing */
    @ManagedAttribute(description = "Tunable In Runtime Attribute",
            currencyTimeLimit = 20,
            defaultValue = "bar",
            persistPolicy = "OnUpdate")
    public void setSomethingToTuneInRuntime(long value) {
        this.somethingToTuneInRuntime = value;
    }

    @ManagedAttribute(defaultValue = "foo", persistPeriod = 300)
    public String getSomethingToTuneInRuntime() {
        return somethingToTuneInRuntime;
    }
}</pre>
<h3>Spring Config</h3>
<p>Now let&#8217;s configure Spring to autoregister our pojos to export and manage/monitor:<br />
Create a jmx-context.xml file in your WEB-INF/* dir</p>
<p>Add: &lt;context:mbean-export/&gt;</p>
<p>Activates default exporting of MBeans by detecting standard MBeans in the Spring<br />
context as well as @ManagedResource annotations on Spring-defined beans.<br />
Rather than defining an MBeanExporter bean, just provide this single element. I could walk you through a simple, simpler and simplest config of spring jmx but with annotational config in the simplest requirements, this is all you need to do to get up and running. If you need object naming in multiple vm situations, you can easily do that and other things too but, that&#8217;s out of scope for this post <img src='http://edelsonmedia.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=JMX%20and%20MBean%20Support%20With%20Spring&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D542"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=542</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Future Posts: Esper, RabbitMQ for Cloud Messaging</title>
		<link>http://edelsonmedia.com/?p=514#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=514#comments</comments>
		<pubDate>Sun, 09 May 2010 15:52:45 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[RabbitMQ]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Cloud Messaging]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=514</guid>
		<description><![CDATA[If I had more time I would add a few new posts on esper and rabbitmq for messaging in the cloud but I just got home from 2 weeks of coast-to-coast consulting and technology presentations. Pretty exhausting. I hope to have time to post on these and a few other fun technologies. I&#8217;ve got some [...]]]></description>
			<content:encoded><![CDATA[<p>If I had more time I would add a few new posts on esper and rabbitmq for messaging in the cloud but I just got home from 2 weeks of coast-to-coast consulting and technology presentations. Pretty exhausting. I hope to have time to post on these and a few other fun technologies. I&#8217;ve got some code samples and tests I might post with that, plus some cools stuff on esper queries with Spring Integration.
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Future%20Posts%3A%20Esper%2C%20RabbitMQ%20for%20Cloud%20Messaging&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D514"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=514</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Sample App</title>
		<link>http://edelsonmedia.com/?p=506#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=506#comments</comments>
		<pubDate>Thu, 15 Apr 2010 01:41:18 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=506</guid>
		<description><![CDATA[I&#8217;ve been traveling a lot as a Senior Consultant with SpringSource and many of the engineers that have been at my private and public engagements on core spring and enterprise integration with spring have requested a copy of my sample app that I use to demonstrate configurations, run demos and tests, etc. 
This week I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been traveling a lot as a Senior Consultant with SpringSource and many of the engineers that have been at my private and public engagements on core spring and enterprise integration with spring have requested a copy of my sample app that I use to demonstrate configurations, run demos and tests, etc. </p>
<p>This week I&#8217;m finally getting it finished and available to check out from svn. I&#8217;ve had a project set up in one of our public-facing repositories, the code will be available next week. Shoot me an email via my SpringSource address &#8211; attendees have that email, or find me on linkedin.com</p>
<p>May 10 I officially move into engineering!</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20Sample%20App&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D506"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=506</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring DAO Exception Translation with @Repository</title>
		<link>http://edelsonmedia.com/?p=488#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=488#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:48:33 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Annotations]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[@Repository]]></category>
		<category><![CDATA[Exception Translation]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=488</guid>
		<description><![CDATA[In Spring, when you mark a DAO/Repository classes with the Spring stereotype annotation, @Repository:
@Repository
public class MyDaoImpl implements MyDao { .. }
spring creates an instance of it in the IoC container as with any other stereotype annotation (@Component, @Service) but it can also add exception translation if you explicitly add this bean declaration to your config:
&#60;bean [...]]]></description>
			<content:encoded><![CDATA[<p>In Spring, when you mark a DAO/Repository classes with the Spring stereotype annotation, @Repository:</p>
<pre class="brush: java" style="font-size: 120%;">@Repository
public class MyDaoImpl implements MyDao { .. }</pre>
<p>spring creates an instance of it in the IoC container as with any other stereotype annotation (@Component, @Service) but it can also add exception translation if you explicitly add this bean declaration to your config:<span style="font-size: x-small;"><br />
&lt;bean  class=&#8221;org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor&#8221;/&gt;</span></p>
<p>This enables translation of native runtime resource exceptions that would otherwise be vendor-specific (database (oracle, etc), orm (hibernate, jpa, etc) to Spring&#8217;s runtime exception hierarchy regardless of what vendors you use over time. As it is simply enabling a feature in the Spring Framework vs something you would use, it does not require a bean id.</p>
<p>Also as the stereotype annotations are meta annotations you can do this to enrich behavior easily</p>
<pre class="brush: java" style="font-size: 120%;">@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Repository
@Primary
@Lazy
public @interface MyRepository {
}</pre>
<pre class="brush: java" style="font-size: 120%;">@MyRepository
public class OtherFooDao implements FooDao { .. }</pre>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20DAO%20Exception%20Translation%20with%20%40Repository&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D488"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=488</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Framework 3.0.2 is Released</title>
		<link>http://edelsonmedia.com/?p=481#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=481#comments</comments>
		<pubDate>Sun, 04 Apr 2010 15:43:27 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=481</guid>
		<description><![CDATA[Read Juergen&#8217;s blog post about the latest release and get the code

    
]]></description>
			<content:encoded><![CDATA[<p>Read <a href="http://blog.springsource.com/2010/04/02/spring-framework-3-0-2-released/">Juergen&#8217;s blog post about the latest release</a> and get the <a href="http://www.springsource.com/download/community">code</a>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20Framework%203.0.2%20is%20Released&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D481"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=481</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Patterns of Scalability and Pathways in Systems</title>
		<link>http://edelsonmedia.com/?p=465#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=465#comments</comments>
		<pubDate>Sun, 04 Apr 2010 06:18:28 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Patterns of Scalability]]></category>
		<category><![CDATA[System Design]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=465</guid>
		<description><![CDATA[Note: this is just a draft &#8211; I was trying to fall asleep, started to think, and this is what I thought about.
In college I wrote a 300-page senior thesis entitled, &#8220;Energy Pathways In Biological Systems&#8221;. It was within the context of genetics to microbiology up through complex pathways of micro-climates to ecosystems and even [...]]]></description>
			<content:encoded><![CDATA[<p>Note: this is just a draft &#8211; I was trying to fall asleep, started to think, and this is what I thought about.</p>
<p>In college I wrote a 300-page senior thesis entitled, &#8220;Energy Pathways In Biological Systems&#8221;. It was within the context of genetics to microbiology up through complex pathways of micro-climates to ecosystems and even pathways of migratory animals (Arctic Wolves that cover at least 1,000 mile territories to Terns and Whales that have annual migration patterns covering half the earth). For each there is movement of elements in space and time. I had a blast researching and writing it but my fascination revolved around that shared concept over seemingly vast discrepancies of scale that were actually sharing massive similarities, being only sizable to other scales, can only be in a relative framework of complexity.</p>
<p>Think of systems as an atom. There are layers or levels and activity going on all the time. Now think of this atomic model with pathways repetitively used for resources to move, kind of like corridors. Resources behave differently from other resources, thus the corridors are different, the speed of motion is different and the size is different. Also production and consumption of those resources is different. Entropy works differently based on environment, among other factors.</p>
<p>The pathways of genetic information through a cell move in a seemingly small scale to Nitrogen pathways in a rain forest but the complexity in a cell looking down to the smaller elements in that system is great. Also in a rain forest, Nitrogen molecules and everything they interact with as they move through that system, looking up to larger components, are equally great and yet looking down to the components that amass that system we see the same thing.</p>
<p>Think about that &#8211; scale, if only quantifiable by the scale of other systems, is relative. So what could lend to differentiation? Complexity could be an important part of the equation. So what about this &#8211; System A is larger and has more components than System B. System B is less complex than System A. If both systems are replicated many times and distributed which may fare better? Hard to say with such a limited theoretical idea but what about Okham&#8217;s Razor &#8211; the simplest way is the best, essentially. In mechanics, the less moving parts, the less points of failure. A human is a complicated system, a virus is a very simple system and yet a virus can so easily attack the more complicated system. Cells replicate very quickly, and each new cell gets its own copy of the genetic instructions the original parent cell had. I&#8217;m rambling but just trying to give some simple examples to think about.</p>
<p>So how do we properly think about scale in systems? What can we learn from successful patterns of scalability that are all around us?
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Patterns%20of%20Scalability%20and%20Pathways%20in%20Systems&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D465"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=465</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ROO vs Grails &#8211; Why both from SpringSource?</title>
		<link>http://edelsonmedia.com/?p=453#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=453#comments</comments>
		<pubDate>Fri, 26 Mar 2010 00:53:49 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Spring ROO]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=453</guid>
		<description><![CDATA[Recently I was asked why SpringSource puts out Grails and ROO, what was the difference. Since I have a pretty good idea but wanted to give this person an expert explanation, I asked Ben Alex who pointed me to this post of his.

    
]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked why SpringSource puts out Grails and ROO, what was the difference. Since I have a pretty good idea but wanted to give this person an expert explanation, I asked <a href="http://www.springsource.com/people/balex">Ben Alex</a> who pointed me to <a title="ROO vs Grails - Why both from SpringSource" href="http://stackoverflow.com/questions/2004669/grails-vs-roo-why-springsource-is-pushing-two-very-similar-technologies"><strong>this post of his</strong></a>.
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=ROO%20vs%20Grails%20%E2%80%93%20Why%20both%20from%20SpringSource%3F&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D453"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=453</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intalling GIT on Mac OSX</title>
		<link>http://edelsonmedia.com/?p=533#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=533#comments</comments>
		<pubDate>Sat, 13 Mar 2010 16:34:37 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=533</guid>
		<description><![CDATA[Being a total nube at it, I didn&#8217;t realize it was as simple as downloading the GIT installer and running it. Since I&#8217;m not into doodleware (i.e. using a ui) I was cloning a GIT repos in seconds.
This is a good guide to simply generating ssh keys: http://help.github.com/mac-key-setup

    
]]></description>
			<content:encoded><![CDATA[<p>Being a total nube at it, I didn&#8217;t realize it was as simple as downloading the <a href="http://code.google.com/p/git-osx-installer" target="_blank">GIT installer</a> and running it. Since I&#8217;m not into doodleware (i.e. using a ui) I was cloning a GIT repos in seconds.</p>
<p>This is a good guide to simply generating ssh keys: <a href="http://help.github.com/mac-key-setup/" target="_blank">http://help.github.com/mac-key-setup</a>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Intalling%20GIT%20on%20Mac%20OSX&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D533"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=533</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating The Deployment Process</title>
		<link>http://edelsonmedia.com/?p=447#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=447#comments</comments>
		<pubDate>Thu, 04 Mar 2010 19:55:41 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Lifecycle]]></category>
		<category><![CDATA[Continuous Interation]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=447</guid>
		<description><![CDATA[How many companies fully automate their deploy process? This is not a new idea but I am bringing it up as it is a very important one. I just read and really like the idea bounced by Martin Fowler here, http://martinfowler.com/bliki/BlueGreenDeployment.html, put forth by Dave Farley and Jez Humble. If you think of the SDLC [...]]]></description>
			<content:encoded><![CDATA[<p>How many companies fully automate their deploy process? This is not a new idea but I am bringing it up as it is a very important one. I just read and really like the idea bounced by Martin Fowler here, <a href="http://martinfowler.com/bliki/BlueGreenDeployment.html">http://martinfowler.com/bliki/BlueGreenDeployment.html</a>, put forth by Dave Farley and Jez Humble. If you think of the SDLC in terms of a manufacturing plant, and around that framework wrap the ideas of LEAN and Six Sigma, not doing this strategy is actually contributing, hundreds of hours per year in high-release companies, to bottlenecks and increase of constraints to flow. The simple idea demonstrated by this sample of blue green deployment shows how simply setting up the proper environment we can easily flip the switch to what instance is production. There are of course many strategies to this, some excellent ones in the cloud and easily transferable to not, particularly when we think in terms of OSGi, but the point remains the same &#8211; critical to do for many business justifications, many ways to do it.
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Automating%20The%20Deployment%20Process&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D447"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=447</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Asynchronous Processing with Spring&#8217;s TaskExecutor</title>
		<link>http://edelsonmedia.com/?p=432#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=432#comments</comments>
		<pubDate>Wed, 27 Jan 2010 19:29:15 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Annotations]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring Task]]></category>
		<category><![CDATA[Asynchronous Processing]]></category>
		<category><![CDATA[Spring Scheduling]]></category>
		<category><![CDATA[TaskExecutor]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=432</guid>
		<description><![CDATA[This post is merely meant as a starting guide to tinkering for a light-weight solution to handing off execution of a task for async processing without the overhead of Spring Batch or Spring JMS and Message Brokers, among other middleware solutions.
1. I have a simplistic junit test that merely kicks off the service method to [...]]]></description>
			<content:encoded><![CDATA[<p>This post is merely meant as a starting guide to tinkering for a light-weight solution to handing off execution of a task for async processing without the overhead of Spring Batch or Spring JMS and Message Brokers, among other middleware solutions.</p>
<p>1. I have a simplistic junit test that merely kicks off the service method to view the path of execution:</p>
<pre class="brush: java" style="font-size:120%">
/**
 * TaskTests
 *
 * @author Helena Edelson
 * @since v 1.0
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:infrastructure-context.xml"})
public class TaskTests extends BaseTest {
    protected static final Logger logger = Logger.getLogger(TaskTests.class);
    @Autowired private OrderService orderService;

    @Test
    public void testExecution(){
        logger.debug("Starting execution thread...");
        orderService.dispatch(new Order());
    }
}</pre>
<p>2. A simple context config:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:context=&#8221;http://www.springframework.org/schema/context&#8221;<br />
xmlns:task=&#8221;http://www.springframework.org/schema/task&#8221;<br />
xmlns:aop=&#8221;http://www.springframework.org/schema/aop&#8221;<br />
xmlns:p=&#8221;http://www.springframework.org/schema/p&#8221;<br />
xsi:schemaLocation=&#8221;<br />
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br />
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd<br />
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd<br />
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd&#8221;&gt;</p>
<p>&lt;bean id=&#8221;taskExecutor&#8221; class=&#8221;org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor&#8221; p:corePoolSize=&#8221;5&#8243; p:maxPoolSize=&#8221;25&#8243;/&gt;</p>
<p>&lt;!&#8211; OR alternately: Creates a org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor &#8211;&gt;<br />
&lt;task:executor id=&#8221;taskExecutor&#8221; pool-size=&#8221;5-25&#8243; queue-capacity=&#8221;100&#8243; rejection-policy=&#8221;CALLER_RUNS&#8221;/&gt;</p>
<p>&lt;/beans&gt;</p>
<p>3. OrderService that delegates to the ThreadPoolTaskExecutor:</p>
<pre class="brush: java" style="font-size:120%">
/**
 * OrderServiceImpl is used for both orders and returns
 *
 * @author Helena Edelson
 * @MessageEndpoint which is a @Component
 * @since Dec 29, 2009
 */
@Service("orderService")
public class OrderServiceImpl implements OrderService {
    private OrderDao orderDao;
    private MerchantService merchantService;
    private ReceivingService receivingService;
    @Autowired private TaskExecutor taskExecutor;

    @Autowired
    public OrderServiceImpl(OrderDao orderDao, ReceivingService receivingService, MerchantService merchantService) {
        this.orderDao = orderDao;
        this.receivingService = receivingService;
        this.merchantService = merchantService;
    }

    public final void dispatch(final Order order) {
        logger.debug("Starting dispatch execution...");

        if (this.taskExecutor != null) {
            this.taskExecutor.execute(new Runnable() {
                public void run() {
                    executorAsync(order);
                }
            });
        }

        logger.debug("Completed dispatch execution...");
    }

    private final void executorAsync(final Order order) {
        logger.debug("Starting Async execution...");

        daoDatasourceOne.createOrder(order);
        daoDatasourceTwo.createOrder(order);

        logger.debug("Completed Async execution...");
    }

/* Where the output will be: Note the dispatch method returns control to its caller before the async method begins:
2010-01-27 13:23:27,546 [main] DEBUG org.springsource.oms.infrastructure.TaskTests  - Starting execution thread...
2010-01-27 13:23:27,546 [main] DEBUG org.springsource.oms.domain.services.OrderServiceImpl  - Starting dispatch execution...
2010-01-27 13:23:27,546 [main] DEBUG org.springsource.oms.domain.services.OrderServiceImpl  - Completed dispatch execution...
2010-01-27 13:23:27,546 [taskExecutor-1] DEBUG org.springsource.oms.domain.services.OrderServiceImpl  - Starting Async execution...
persisting org.springsource.oms.domain.entities.Order@1f10a67
*/

/**
* Alternately for a different scenario you can play around with this:
*/
public void withExecutor(final Order order) {
        try {
            CompletionService<Object> completionService = new ExecutorCompletionService<Object>(taskExecutor);

            Object result1 = completionService.submit(new Callable<Object>() {
                public Object call() {
                    return daoDatasourceOne.createOrder(order);
                }
            });
            Object result2 = completionService.submit(new Callable<Object>() {
                public Object call() {
                    return daoDatasourceTwo.createOrder(order);
                }
            });

            completionService.take().get();
            completionService.take().get();

        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }

    }
}
</pre>
<p>I recommend looking into the @Async annotation, which I will post on shortly. In the meantime here is the ref page for Spring Task and Scheduling: http://static.springsource.org/spring/docs/3.0.x/reference/html/scheduling.html
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Simple%20Asynchronous%20Processing%20with%20Spring%E2%80%99s%20TaskExecutor&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D432"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=432</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Spring Integration</title>
		<link>http://edelsonmedia.com/?p=422#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=422#comments</comments>
		<pubDate>Wed, 20 Jan 2010 16:52:25 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Enterprise Integration Patterns]]></category>
		<category><![CDATA[Spring Integration]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=422</guid>
		<description><![CDATA[If you have Maven installed:

Download the samples
Unzip them
At the command line, cd into the samples dir and enter: mvn install
In your IDE of choice, set up the project from the root pom

If you are familiar with Enterprise Integration Patterns, here are some of the patterns implemented in each sample:



Pattern / Sample
Event Driven Consumer
Polling Consumer
Message Filter
Message [...]]]></description>
			<content:encoded><![CDATA[<p>If you have Maven installed:</p>
<ol>
<li>Download the <a href="http://static.springsource.org/spring-integration/samples/1.0.x/spring-integration-samples-1.0.3-20090721151407.zip">samples</a></li>
<li>Unzip them</li>
<li>At the command line, cd into the samples dir and enter: mvn install</li>
<li>In your IDE of choice, set up the project from the root pom</li>
</ol>
<p>If you are familiar with <a href="http://www.enterpriseintegrationpatterns.com/" target="_blank">Enterprise Integration Patterns</a>, here are some of the patterns implemented in each sample:</p>
<table border="1">
<thead>
<tr>
<td align="left"><strong>Pattern / Sample</strong></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/EventDrivenConsumer.html" target="_blank">Event Driven Consumer</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/PollingConsumer.html" target="_blank">Polling Consumer</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/Filter.html" target="_blank">Message Filter</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/MessageTranslator.html" target="_blank">Message Translator</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/ContentBasedRouter.html" target="_blank">Content Based Router</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/Sequencer.html" target="_blank">Splitter</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/Aggregator.html" target="_blank">Aggregator</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/ChannelAdapter.html" target="_blank">Channel Adapter</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/MessagingGateway.html" target="_blank">Messaging Gateway</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/MessagingAdapter.html" target="_blank">Service Activator</a></td>
<td align="center"><a href="http://enterpriseintegrationpatterns.com/RequestReply.html" target="_blank">Request/Reply</a></td>
</tr>
</thead>
<tbody>
<tr>
<td align="left">cafe</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">filecopy</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">errorhandling</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center">X</td>
</tr>
<tr>
<td align="left">helloworld</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">jms</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>
<tr>
<td align="left">oddeven</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">quote</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">ws</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
</tr>
<tr>
<td align="left">xml</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
<td align="center">X</td>
<td align="center"></td>
</tr>
</tbody>
</table>
<p><em><strong>From Mark Fisher&#8217;s Post:</strong></em></p>
<p><em><strong>*NOTE:</strong> All of the samples feature certain common patterns that are essential to the underlying Spring Integration core:</em></p>
<ul>
<li><a href="http://enterpriseintegrationpatterns.com/Message.html" target="_blank">Message</a>: Spring Integration Messages encapsulate a POJO payload and a header Map (<a href="http://static.springsource.org/spring-integration/reference/htmlsingle/spring-integration-reference.html#message" target="_blank">Reference</a>).</li>
<li><a href="http://enterpriseintegrationpatterns.com/MessageChannel.html" target="_blank">Message Channel</a>: Spring Integration includes many Message Channel options for both point-to-point and publish-subscribe. Some include queues for buffering while others dispatch directly to subscribers (<a href="http://static.springsource.org/spring-integration/reference/htmlsingle/spring-integration-reference.html#channel-configuration" target="_blank">Reference</a>).</li>
<li><a href="http://enterpriseintegrationpatterns.com/MessageEndpoint.html" target="_blank">Message Endpoint</a>: At a high level, this includes all components that connect to channels for input and/or output.</li>
<li><a href="http://enterpriseintegrationpatterns.com/MessagingMapper.html" target="_blank">Messaging Mapper</a>: Spring Integration binds inbound Messages to method arguments and method return values to Message payloads and/or headers.</li>
<li><a href="http://enterpriseintegrationpatterns.com/MessageDispatcher.html" target="_blank">Message Dispatcher</a>: In Spring Integration, channels that do not have a queue use Message Dispatchers to invoke their subscribers.</li>
<li><a href="http://enterpriseintegrationpatterns.com/PipesAndFilters.html" target="_blank">Pipes and Filters</a>: This is the most general pattern describing Message-processing components connected in a loosely-coupled way via channels.</li>
<li><a href="http://enterpriseintegrationpatterns.com/MessageBus.html" target="_blank">Message Bus</a>: Spring Integration essentially turns a Spring ApplicationContext into a lightweight Message Bus within which all of these other components are hosted.</li>
</ul>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Getting%20Started%20with%20Spring%20Integration&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D422"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=422</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Roo 1.0.0 Released</title>
		<link>http://edelsonmedia.com/?p=410#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=410#comments</comments>
		<pubDate>Thu, 31 Dec 2009 17:02:45 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Configuration Management]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring ROO]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=410</guid>
		<description><![CDATA[Just released today!
http://blog.springsource.com/2009/12/31/spring-roo-1-0-0-released/

    
]]></description>
			<content:encoded><![CDATA[<p>Just released today!</p>
<p>http://blog.springsource.com/2009/12/31/spring-roo-1-0-0-released/</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20Roo%201.0.0%20Released&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D410"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=410</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JMS ActiveMQ Broker Topologies and High-Availability Configuration</title>
		<link>http://edelsonmedia.com/?p=143#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=143#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:30:58 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[ActiveMQ]]></category>
		<category><![CDATA[JMS]]></category>
		<category><![CDATA[JMS Broker]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Spring JMS]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Broker]]></category>
		<category><![CDATA[Broker Topology]]></category>
		<category><![CDATA[Brokers]]></category>
		<category><![CDATA[JMX]]></category>
		<category><![CDATA[Master Slave]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.edelsonmedia.com/?p=143</guid>
		<description><![CDATA[



Pure Master Slave Simplified Topology
I am not actually going to go into Broker topologies, there are many great resources for that such as this by Bruce Snyder: http://www.slideshare.net/bruce.snyder/messaging-with-activemq-presentation or http://activemq.apache.org/topologies.html, all great stuff. This example uses a store and forward topology, or, distributed queues, and incorporates basic authentication:
My use case was to handle down JMS [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td valign="top"><img src="images/BrokerTopology-05-07-09_sm.png" border="0" alt="Pure Master Slave BrokerTopology" align="left" /><br />
<strong>Pure Master Slave Simplified Topology</strong></td>
<td valign="top">I am not actually going to go into Broker topologies, there are many great resources for that such as this by Bruce Snyder: <a href="http://www.slideshare.net/bruce.snyder/messaging-with-activemq-presentation" target="_blank">http://www.slideshare.net/bruce.snyder/messaging-with-activemq-presentation</a> or <a href="http://activemq.apache.org/topologies.html" target="_blank">http://activemq.apache.org/topologies.html</a>, all great stuff. This example uses a store and forward topology, or, distributed queues, and incorporates basic authentication:</p>
<p>My use case was to handle down JMS Servers. What I needed to do was implement failover as well as master slave strategies and a topology for message redundancy in case of hardware failure, etc. The client could not have any message loss. With failover, you can see how ActiveMQ switches from the main broker to the second, third, etc on failure. I have a case of four JMS servers in production, each server it is on is load balanced.</p>
<p>There are just a few configurations to add or modify in order to set up JMS Failover with Master/Slave for your broker topology. Here is a basic configuration. For this use case, all JMS servers are configured as standalone versus embedded.</td>
</tr>
</tbody>
</table>
<h2>I. Client URI</h2>
<p>You will need to add the Failover protocol, either with a basic URI pattern or a composite. In this use case, there are load balanced servers in Production and multiple Development and QA environments which require different configurations for master/slave and failover.</p>
<blockquote><p>In your application&#8217;s properties file for messaging add a modified version of this with your mappings:<br />
<code>activemq.broker.uri=failover://(tcp://localhost:61616,tcp://slaveh2:61616,tcp://master2:61616,tcp://slave2:61616,network:static://(tcp://localhost:61616,tcp://master2:61616,tcp://slave2:61616))?randomize=false</code>
</p></blockquote>
<p><em>Note: I set connections as locked down (static) communication configurations vs multicast or dynamic discovery so that I know exactly what servers can communicate with each other and how. Also this is assuming you have one set per environment to account for mapping the appropriate IP&#8217;s in development, qa, production, dr, etc.</em></p>
<p><em>Note: Do not configure networkConnections for master slave, they are handled on the slave with the following configuration:</em><br />
<code>&lt;masterConnector remoteURI= "tcp://masterhost:61616" userName="wooty" password="woo"/&gt;</code></p>
<h2>II. Spring Configuration</h2>
<blockquote><p>
<code>&lt;bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"<br />
destroy-method="stop"&gt;<br />
  &lt;property name="connectionFactory"&gt;<br />
    &lt;bean class="org.apache.activemq.spring.ActiveMQConnectionFactory"&gt;<br />
        &lt;constructor-arg value="${amq.broker.uri}"/&gt;<br />
        &lt;property name="userName" value="${activemq.username}"/&gt;<br />
        &lt;property name="password" value="${activemq.password}"/&gt;<br />
    &lt;/bean&gt;<br />
  &lt;/property<br />
&lt;/bean&gt;</code>
</p></blockquote>
<h2>III. Broker Configuration</h2>
<h3>Master</h3>
<blockquote><p>
<code>&lt;broker brokerName="{hostname}" waitForSlave="true" xmlns="http://activemq.apache.org/schema/core"  dataDirectory="${activemq.base}/data"&gt;</code><br />
<code>&lt;networkConnectors&gt;<br />
    &lt;!-- passed in by the client broker URI so you can easily manager per environment: sweet --&gt;<br />
&lt;/networkConnectors&gt;</code><br />
<code>&lt;transportConnectors&gt;<br />
  &lt;!-- TCP uses the OpenWire marshaling protocol to convert messages to stream of bytes (and back) --&gt;<br />
  &lt;transportConnector name="tcp" uri="tcp://localhost:61616?trace=true" /&gt;<br />
  &lt;transportConnector name="nio" uri="nio://localhost:61618?trace=true" /&gt;<br />
  &lt;!-- &lt;transportConnector name="ssl" uri="ssl://localhost:61617"/&gt;<br />
  &lt;transportConnector name="http" uri="http://localhost:61613"/<br />
  &lt;transportConnector name="https" uri="https://localhost:61222"/&gt; --&gt;<br />
  &lt;transportConnectors&gt;<br />
&lt;/transportConnectors&gt;</p>
<p>&lt;!-- Basic security and credentials --&gt;<br />
	  &lt;plugins&gt;<br />
            &lt;simpleAuthenticationPlugin&gt;<br />
                &lt;users&gt;<br />
                    &lt;authenticationUser username="system" password="manager" groups="admin, publishers,consumers"/&gt;<br />
                &lt;/users&gt;<br />
            &lt;/simpleAuthenticationPlugin&gt;<br />
        &lt;/plugins&gt;</code><br />
<code>..more configuration<br />
&lt;/broker&gt;</code>
</p></blockquote>
<h3>Slave: for ActiveMQ 4.1 or later which also allows for authentication as show below</h3>
<blockquote><p>
<code>&lt;broker brokerName="{hostname}Slave" deleteAllMessagesOnStartup="true"  xmlns="http://activemq.apache.org/schema/core"&gt;<br />
&lt;transportConnectors&gt;<br />
   &lt;transportConnector uri="tcp://localhost:61616"/&gt;<br />
&lt;/transportConnectors&gt;</code><br />
<code>&lt;services&gt;<br />
    &lt;masterConnector remoteURI= "tcp://masterhost:62001" userName="wooty" password="woo"/<br />
&lt;/services&gt;<br />
&lt;!-- Basic security and credentials --&gt;<br />
	  &lt;plugins&gt;<br />
            &lt;simpleAuthenticationPlugin&gt;<br />
                &lt;users&gt;<br />
                    &lt;authenticationUser username="system" password="manager" groups="admin, publishers,consumers"/&gt;<br />
                &lt;/users&gt;<br />
            &lt;/simpleAuthenticationPlugin&gt;<br />
        &lt;/plugins&gt;</code><br />
<code>&lt;/broker&gt;</code>
</p></blockquote>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=JMS%20ActiveMQ%20Broker%20Topologies%20and%20High-Availability%20Configuration&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D143"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=143</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Maven To Compile With Java 1.6</title>
		<link>http://edelsonmedia.com/?p=398#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=398#comments</comments>
		<pubDate>Sat, 28 Nov 2009 15:42:05 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=398</guid>
		<description><![CDATA[&#60;project&#62;
&#8230;
&#60;build&#62;
&#60;finalName&#62;${groupId}&#60;/finalName&#62;
&#60;plugins&#62;
&#60;plugin&#62;
&#60;groupId&#62;org.apache.maven.plugins&#60;/groupId&#62;
&#60;artifactId&#62;maven-compiler-plugin&#60;/artifactId&#62;
&#60;version&#62;2.0.2&#60;/version&#62;
&#60;configuration&#62;
&#60;source&#62;1.6&#60;/source&#62;
&#60;target&#62;1.6&#60;/target&#62;
&#60;/configuration&#62;
&#60;/plugin&#62;
&#60;/plugins&#62;
&#60;/build&#62;
&#8230;
&#60;/project&#62;

    
]]></description>
			<content:encoded><![CDATA[<p>&lt;project&gt;<br />
&#8230;<br />
&lt;build&gt;<br />
&lt;finalName&gt;${groupId}&lt;/finalName&gt;<br />
&lt;plugins&gt;<br />
&lt;plugin&gt;<br />
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br />
&lt;version&gt;2.0.2&lt;/version&gt;<br />
&lt;configuration&gt;<br />
&lt;source&gt;1.6&lt;/source&gt;<br />
&lt;target&gt;1.6&lt;/target&gt;<br />
&lt;/configuration&gt;<br />
&lt;/plugin&gt;<br />
&lt;/plugins&gt;<br />
&lt;/build&gt;<br />
&#8230;<br />
&lt;/project&gt;
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Getting%20Maven%20To%20Compile%20With%20Java%201.6&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D398"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=398</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Roo</title>
		<link>http://edelsonmedia.com/?p=394#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=394#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:40:28 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring ROO]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=394</guid>
		<description><![CDATA[Tuesday I went to Ben Alex&#8217;s presentation at SpringOne on Roo. He literally build a basic but pretty comprehensive web application in ten minutes and walked us through it. I&#8217;ll write some more about it soon but the main project site is
springsource.org/roo, which pretty much says it all

    
]]></description>
			<content:encoded><![CDATA[<p>Tuesday I went to Ben Alex&#8217;s presentation at SpringOne on Roo. He literally build a basic but pretty comprehensive web application in ten minutes and walked us through it. I&#8217;ll write some more about it soon but the main project site is<br />
<a href="http://www.springsource.org/roo">springsource.org/roo</a>, which pretty much says it all
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Spring%20Roo&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D394"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=394</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transaction Isolation and Spring Transaction Management</title>
		<link>http://edelsonmedia.com/?p=401#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://edelsonmedia.com/?p=401#comments</comments>
		<pubDate>Thu, 22 Oct 2009 00:41:14 +0000</pubDate>
		<dc:creator>Helena Edelson</dc:creator>
				<category><![CDATA[AOP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Transaction Management]]></category>

		<guid isPermaLink="false">http://edelsonmedia.com/?p=401</guid>
		<description><![CDATA[I was asked a question by a Spring student of mine and as it pertains to Spring Transaction Management, as well as transaction  management and databases in general I thought I&#8217;d share it with everyone if it may help anyone else. The question went something like this:
How do we prevent concurrent modification of the same [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked a question by a Spring student of mine and as it pertains to Spring Transaction Management, as well as transaction  management and databases in general I thought I&#8217;d share it with everyone if it may help anyone else. The question went something like this:</p>
<p>How do we prevent concurrent modification of the same data? Two users are in the middle of a transaction on the same data. How do we isolate those operations so that other transactions can not read the data and how to we handle synchronizing  changes to that data with commits? This deals with preserving  data integrity, the underlying locking mechanisms of your database, transaction demarcation and transaction isolation settings which are configurable by Spring Transaction Management but ultimately controlled by your specific database vendor&#8217;s implementation.</p>
<p>Some ways to think about transaction isolation are:</p>
<ol>
<li> The effects of one transaction are not visible to another until the transaction completes</li>
<li>The degree of isolation one transaction has from the work of other transactions</li>
</ol>
<p>So how do we keep one transaction from seeing uncommitted writes from other transactions and synchronize those writes?</p>
<p>Remember ACID = Atomicity, Consistency, Isolation and Durability?</p>
<p>The <acronym>SQL</acronym> standard defines four levels of transaction isolation in terms of three phenomena that must be prevented between concurrent transactions. These phenomena are:</p>
<div>
<dl>
<dt><strong>Dirty read:</strong> A transaction reads data written by a concurrent uncommitted transaction.</dt>
<dt><strong>Nonrepeatable read</strong>: A transaction re-reads data it has previously read and finds that data has been modified by another transaction (that committed since the initial read).</dt>
<dt><strong>Phantom read</strong>: A transaction re-executes a query returning a set of rows that satisfy a search condition and finds that the set of rows satisfying the condition has changed due to another recently-committed transaction.</dt>
</dl>
</div>
<p>For most databases, the default transaction isolation level is &#8220;read committed&#8221; (your transaction operates on the data that it sees at the beginning of the transaction). You can, for example, configure transactions to be serializable which increases lock contention, but is more suited for critical operations. Here we could get into database locking, predicate locking, etc. While it is outside the scope of this post, it is very worthwhile to know; I do suggest reading up on it.</p>
<p>In the java layer, here are the standard isolation levels defined in the JDBC specification, in order of weakest to strongest isolation, with the respective inverse correlation on performance:</p>
<p>• TRANSACTION_NONE: transactions are not supported.<br />
• TRANSACTION_READ_UNCOMMITTED: dirty reads, non-repeatable reads and phantom reads can occur.<br />
• TRANSACTION_READ_COMMITTED: dirty reads are prevented; non-repeatable reads and phantom reads can occur.<br />
• TRANSACTION_REPEATABLE_READ: reads and non-repeatable reads are prevented; phantom reads can occur.<br />
• TRANSACTION_SERIALIZABLE: dirty reads, non-repeatable reads and phantom reads are prevented.</p>
<p>Spring&#8217;s Transaction Management Isolation levels:</p>
<p><code><strong><a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/transaction/TransactionDefinition.html#ISOLATION_DEFAULT">ISOLATION_DEFAULT</a></strong></code><br />
Use the default isolation level of the underlying datastore.</p>
<p><code><strong><a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/transaction/TransactionDefinition.html#ISOLATION_READ_COMMITTED">ISOLATION_READ_COMMITTED</a></strong></code><br />
Indicates that dirty reads are prevented; non-repeatable reads and  phantom reads can occur. This level only prohibits a transaction from reading a row  with uncommitted changes in it.</p>
<p><code><strong><a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/transaction/TransactionDefinition.html#ISOLATION_REPEATABLE_READ">ISOLATION_REPEATABLE_READ</a></strong></code><br />
Indicates that dirty reads and non-repeatable reads are prevented;  phantom reads can occur. This level prohibits a transaction from reading a row with  uncommitted changes in it, and it also prohibits the situation  where one transaction reads a row, a second transaction alters  the row, and the first transaction rereads the row, getting  different values the second time (a &#8220;non-repeatable read&#8221;).</p>
<p><code><strong><a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/transaction/TransactionDefinition.html#ISOLATION_SERIALIZABLE">ISOLATION_SERIALIZABLE</a></strong></code><br />
Indicates that dirty reads, non-repeatable reads and phantom reads  are prevented. This level includes the prohibitions in  <a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/transaction/TransactionDefinition.html#ISOLATION_REPEATABLE_READ"><code>ISOLATION_REPEATABLE_READ</code></a> and further prohibits the  situation where one transaction reads all rows that satisfy a  <code>WHERE</code> condition, a second transaction inserts a  row that satisfies that <code>WHERE</code> condition, and the  first transaction rereads for the same condition, retrieving  the additional &#8220;phantom&#8221; row in the second read.</p>
<p>Note the Spring isolation and JDBC isolation levels are the same.</p>
<p>So for XML configuration of transaction demarcation in Spring:</p>
<p>&lt;tx:advice id=&#8221;txAdvice&#8221; transaction-manager=&#8221;transactionManager&#8221;&gt;<br />
&lt;tx:attributes&gt;<br />
&lt;tx:method name=&#8221;insert*&#8221; read-only=&#8221;false&#8221; propagation=&#8221;REQUIRED&#8221; isolation=&#8221;READ_COMMITTED&#8221;/&gt;<br />
&lt;/tx:attributes&gt;<br />
&lt;/tx:advice&gt;</p>
<p>And for Annotation configuration:</p>
<p>in xml: <code>&lt;tx:annotation-driven/&gt; </code>to enable @Transactional</p>
<p>in your service layer,  on the class or method level:</p>
<pre class="brush: java">
@Transactional
public class DefaultFooService implements FooService { ...} </pre>
<pre class="brush: java">@Transactional(isolation = Isolation.SERIALIZABLE)
pubic void createSomething(..){ ... }</pre>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Helena%20Edelson&amp;siteurl=http%3A%2F%2Fedelsonmedia.com%2F&amp;linkname=Transaction%20Isolation%20and%20Spring%20Transaction%20Management&amp;linkurl=http%3A%2F%2Fedelsonmedia.com%2F%3Fp%3D401"><img src="http://edelsonmedia.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Save/Bookmark"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://edelsonmedia.com/?feed=rss2&amp;p=401</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
