<?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>let x=x &#187; infrastructure and frameworks</title>
	<atom:link href="http://www.crazymcphee.net/x/category/tech/architecture/infrastructure-and-frameworks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crazymcphee.net/x</link>
	<description>programming idiom and methodology</description>
	<lastBuildDate>Fri, 27 Jan 2012 09:36:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>blog link: world–</title>
		<link>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:28:34 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/</guid>
		<description><![CDATA[world– by Robert Merkel at Larvatus Prodeo. Published October 14, 2011 at 09:02AM The technology world has just lost another giant, though one without the towering public persona of Steve Jobs. If you’re not actually a programmer, you’ve probably never heard of Dennis Ritchie. But the vast majority of software you use was built using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://larvatusprodeo.net/2011/10/14/world/">world–</a> by Robert Merkel at <a href="http://larvatusprodeo.net">Larvatus Prodeo</a>. Published October 14, 2011 at 09:02AM</p>
<blockquote><p>The technology world has just lost another giant, though one without the towering public persona of Steve Jobs.</p>
<p>If you’re not actually a programmer, you’ve probably never heard of <a href="http://www.washingtonpost.com/blogs/blogpost/post/dennis-ritchie-father-of-c-programming-language-and-unix-dies-at-70/2011/10/13/gIQADGNbhL_blog.html">Dennis Ritchie</a>. But the vast majority of software you use was built using a tool that he originally designed, and the rest by tools that very liberally sample from his.</p>
<p>The “native language” that the central processor in a computer understands is an ornery beast. For one thing, back in the 1970s every two-bit computer company (if you’ll pardon the techy pun) had its own native language; these days, there still remain two very common ones, and dozens of less common examples out there. More importantly, it’s almost incomprehensible, even to most programmers. Take this little snippet, part of the preliminaries to a very simple program that just prints the message “hello, world” to the screen:</p>
<pre>_start:
        mov    eax, 4
        mov    ebx, 1
        mov    ecx, str
        mov    edx, str_len
        int    80h</pre>
<p>Writing long and complicated bits of software with such unhelpful notation is extremely slow and error-prone.</p>
<p>“High-level” languages, that allowed the logic of software to be expressed in more compact and readable notation, had existed since the 1950s; <a href="http://en.wikipedia.org/wiki/Grace_Hopper">Grace Hopper</a> was responsible for one of the first. Over time, more and more of the scientific and business software run on the large computers of the era was written in FORTRAN, COBOL, and other high-level langages. However, the “operating systems”, the software plumbing that joined those applications to the hardware, was invariably written in the machine language of specific systems.</p>
<p>In the late 1960s, Ritchie, working with Ken Thompson at Bell Laboratories, hacked together their own little operating system for an obsolete computer nobody was making use of. It was small, but it worked, and was one of the first practical systems to support “timesharing” – the ability for multiple users to run multiple programs simultaneously and interactively. Fairly early on, they had another brainwave; they would rewrite as much of the system – which became known as Unix – as possible in a high-level programming language, to speed development. But first, they needed a suitable high-level language. The resulting language, an evolution of earlier languages entitled BCPL and B, was called “C”.</p>
<p>Both C and Unix were raging successes, partly because of their inherent strengths. The use of C allowed Unix to be “ported” to many different computer systems, a process that continues today as its spiritual successor Linux, written in C, runs on everything from IBM mainframes (and the amphormous “Googleplex” of Google’s servers which, reportedly, draw 240 megawatts of power), to virtually every smartphone on the planet (the iPhone’s operating system is not Linux, but it is also a derivation of Unix and substantial parts are written in C). They also had the good fortune, as with the Internet and World Wide Web which owes so much to both, that they gradually escaped the crush of intellectual property law to become part of the intellectual commons of the field.</p>
<p>Almost as important was the elegance and economy that Ritchie, along with Brian Kernighan, brought to teaching the language. Their textbook <a href="http://en.wikipedia.org/wiki/The_C_Programming_Language">The C Programming Language</a> remains the best programming language textbook ever written, in my view, and the one that I still strongly recommend to my students.</p>
<p>Much of the Windows operating system, and Mac OS X, are implemented in C. Those parts that aren’t, are implemented in computer languages directly derived from it – C++ and Objective-C. Most of the software that runs on those systems is also written in C or its successor languages. And perhaps the most pervasive “new” high-level language of the last 20 years – Java – retains so much of C’s “look and feel” that it often takes a second glance to tell which language a piece of code is written in.</p>
<p>Neither C nor Unix were by any means perfect. While some of its design faults have been eliminated in its successors others remain, and will likely continue to bamboozle neophyte (and, all too often, experienced) programmers, for generations to come. But there was so much he and his colleagues got right. Fate did play its part, but there are very good reasons that generations of software developers not yet born will express themselves in notations largely based on Ritchie’s.</p>
<p>RIP, dmr.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dennis Ritchie: The Shoulders Steve Jobs Stood On &#124; Wired Enterprise &#124; Wired.com</title>
		<link>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:28:02 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=662</guid>
		<description><![CDATA[“Jobs’ genius is that he builds these products that people really like to use because he has taste and can build things that people really find compelling. Ritchie built things that technologists were able to use to build core infrastructure that people don’t necessarily see much anymore, but they use everyday.” via Dennis Ritchie: The [...]]]></description>
			<content:encoded><![CDATA[<p>“Jobs’ genius is that he builds these products that people really like to use because he has taste and can build things that people really find compelling. Ritchie built things that technologists were able to use to build core infrastructure that people don’t necessarily see much anymore, but they use everyday.”</p>
<p>via <a href="http://www.wired.com/wiredenterprise/2011/10/thedennisritchieeffect">Dennis Ritchie: The Shoulders Steve Jobs Stood On | Wired Enterprise | Wired.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring, JPA/JTA, and multiple persistence units, with view transactions</title>
		<link>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 13:31:32 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=655</guid>
		<description><![CDATA[I have grappled with this topic before. Tonight, after 13 hours of struggle, I finally got my web app perfected in this regard. It all started when I needed to start the Transaction out in the view, i.e. as soon as the resource is opened on the HTTP side (rather than when the database service [...]]]></description>
			<content:encoded><![CDATA[<p>I have <a href="http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/">grappled with this topic</a> before. Tonight, after 13 hours of struggle, I finally got my web app perfected in this regard.</p>
<p>It all started when I needed to start the Transaction out in the view, i.e. as soon as the resource is opened on the HTTP side (rather than when the database service layer is called). I&#8217;m using JPA for a number of reasons;</p>
<ol>
<li>I need to access multiple databases each with a different schema (this means different connections)</li>
<li>They need to have XA transactions.</li>
<li>I&#8217;d like the transactions managed by the container (JTA).</li>
</ol>
<p>JPA provides all these things easily without all the complex Hibernate.xbm.xml mapping files and what-have-you.</p>
<p>The trick to starting the transaction with the web session is to use spring&#8217;s <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">OpenEntityManagerInViewFilter</span>. Unfortunately I was using  <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">PersistenceAnnotationBeanPostProcessor</span> to manage my multiple persistence units. The filter wants to know what <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">EntityManagerFactory </span>it should bind to, and fair enough. But with my minimal configuration, there was no addressable EntityManagerFactory!</p>
<p>The solution was to stop the <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">PersistenceAnnotationBeanPostProcessor <span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">from doing the JNDI look ups and bind each PersistenceUnit into the Spring context with a manual JNDI lookup;</span></span></p>
<pre>  &lt;tx:annotation-driven /&gt;
  &lt;tx:jta-transaction-manager /&gt;

  &lt;bean id="pabpp" 
   class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt;</pre>
<pre>
  &lt;jee:jndi-lookup id="onePU" jndi-name="persistence/onePU" /&gt;
  &lt;jee:jndi-lookup id="twoPU" jndi-name="persistence/twoPU" /&gt;
  &lt;jee:jndi-lookup id="threePU" jndi-name="persistence/threePU" /&gt;</pre>
<p>then, in the web.xml the ViewFilter could be bound explicitly to the required persistence unit, in this case &#8220;onePU&#8221;. A fuller explanation can be found on my spring source forum post here; <a href="http://forum.springsource.org/showthread.php?115844-OpenEntityManagerInViewFilter-with-JPA-PersistenceAnnotationBeanPostProcessor">http://forum.springsource.org/showthread.php?115844-OpenEntityManagerInViewFilter-with-JPA-PersistenceAnnotationBeanPostProcessor</a></p>
<p>Overall, this is now quite an elegant solution.</p>
<p><strong>UPDATE</strong>. More documentation of the solution and the various configurations at the Spring forum here: <a href="http://forum.springsource.org/showthread.php?115587-Example-for-using-two-databases-w-Spring-amp-JTA-transaction-manager&amp;p=383432#post383432">http://forum.springsource.org/showthread.php?115587-Example-for-using-two-databases-w-Spring-amp-JTA-transaction-manager&amp;p=383432#post383432</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UNIX timezone database shut down</title>
		<link>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 22:38:38 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=641</guid>
		<description><![CDATA[The UNIX time zone database has been shut down because of copyright complaints! Overthrow the DCMA! http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html]]></description>
			<content:encoded><![CDATA[<p>The UNIX time zone database has been shut down because of copyright complaints! Overthrow the DCMA! <a href="http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html">http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST-based architectural style, a big winner</title>
		<link>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/</link>
		<comments>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 09:45:09 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=629</guid>
		<description><![CDATA[Recently been deeply stuck in building software (apart from starting my PhD part-time). A long time ago I wrote about dynamically loading Spring contexts and component discovery &#8211; this system I&#8217;ve been building is an evolution of that one. We decided to adopt an most REST-based style to integrate between our components. Now, &#8220;run-time&#8221; discovery [...]]]></description>
			<content:encoded><![CDATA[<p>Recently been deeply stuck in building software (apart from starting my <a href="http://monumentum.tumblr.com/">PhD</a> part-time). A long time ago I wrote about <a href="http://www.crazymcphee.net/x/2010/04/29/dynamically-loading-spring-contexts-from-the-classpath-at-runtime/">dynamically loading Spring contexts and component discovery</a> &#8211; this system I&#8217;ve been building is an evolution of that one. We decided to adopt an most REST-based style to integrate between our components. Now, &#8220;run-time&#8221; discovery and configuration is easy, a matter of scraping REST URLs for the resources they contain (or even, just assuming a resource URL will be available and finding out its capabilities, or even its unavailability. at run-time). We&#8217;re using this architecture in places where you&#8217;d otherwise be employing messaging-based systems or pure-Java database service layers. Now we just convert the payload to XML/JSON and POST/PUT/GET/DELETE etc to a http URL! You&#8217;d think that this would kill performance, but we&#8217;ve found the degradation to be minimal (it helps that our transactions tend to be infrequent, but large in data set size). This is a big saving on complexity for our system &#8211; the transaction boundaries nearly always relate to the http URL calls so no more heavy reliance on things like <a href="http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/">XA transactions and JTA Transaction Managers</a>. We still have them, as we need them in a couple of places for the moment, but it&#8217;s no longer such a big freaking deal for us in every situation.</p>
<p>Our system has generic components which &#8220;pass off&#8221; specific knowledge of specific data sets to specific processing components, where there are not a fixed set of these specific components available to all the generic components. In classic OO design this is achieved with interfaces and many design patterns like the Visitor Pattern. In our design we&#8217;ve replaced much of the complexity of the interface with REST-based architecture. Our application has become far more modular (despite its run-time complexity). More importantly, we are at the the point where we can easily start delivering the advanced features that the business has now specified for us without introducing a massive bloat-o-burger one-size-fits-all set of &#8220;common data definitions&#8221; that are the union of all possible sub-system functionalities.  Each sub-system can have its specific features required for that data set and still satisfy the handful of generic actions it is required to support. Each of these specific features can be developed in isolation. It&#8217;s a big win for us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broken Weblogic JMS &#8220;clustering&#8221;</title>
		<link>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/</link>
		<comments>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 08:54:15 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[coherence]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=606</guid>
		<description><![CDATA[I&#8217;ve ranted before that Weblogic 11g clustering/distribution technology of its messaging is fundamentally broken. Despite what Oracle claims, JMS in Weblogic is not clustered. Load balanced is a better description. It&#8217;s architectural &#8211; if any other technology (e.g. SOA Suite, EDN, etc) uses Weblogic JMS as its underlying messaging implementation, it will be broken too. [...]]]></description>
			<content:encoded><![CDATA[<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} -->I&#8217;ve ranted before that Weblogic 11g clustering/distribution technology of its messaging is <a href="http://www.crazymcphee.net/x/2010/11/05/stuff-that-is-just-plain-wrong-part-1893567/">fundamentally broken</a>. Despite what Oracle claims, JMS in Weblogic is not clustered. <em>Load balanced </em>is a better description. It&#8217;s architectural &#8211; if any other technology (e.g. SOA Suite, EDN, etc) uses Weblogic JMS as its underlying messaging implementation, it will be broken too.</p>
<p>The problem is simple. In Weblogic, if you cluster a <em>logical</em> topic (or a queue) across two machines, underlying this you&#8217;ve actually got two uniquely named and non-cooperating <em>physical</em> topics, one on each member of the cluster. A topic message that is sent to the <em>logical</em> topic is delivered (copied) to both physical topics. Now, if your logical topic <em>listener</em> is also clustered, you&#8217;ve got, in effect, <em>two</em> physical topic listeners on <em>two</em> different, and non-cooperating, physical topics. The topic message is then always delivered twice &#8211; even if both listeners have <em>identical</em> durable subscription ids (i.e. indicating that they belong to the same <em>logical</em> component, which should only get the topic message once). This terrible architectural blunder occurs because there is physically underlying your logical configuration, totally separate, non-cooperating, uniquely-named topics on each of the cluster members, with what amounts to a JNDI name service hack in the middle to spray the load about your cluster. In other words, it is <em>load balanced</em>, not clustered. JMS <em>Queues</em> are the same &#8211; however its just that the implicit side-effects of the queue semantics &#8211; which ever only delivers to a single consumer even if there are many configured &#8211; means it isn&#8217;t impacted as much. Because of that semantic, a queue message is only delivered to <em>one</em> of the two physical queues (i.e. again, it&#8217;s load-balanced) so only one of your two clustered queue listeners gets the message. And there&#8217;s a terrible time-out based hack to redeliver the message to another member of your queue cluster just in case there isn&#8217;t any listener instances on the cluster that the message ends up on.</p>
<p>N.B. Coherence does not, apparently, have this massive architectural fail. If you need to do <em>clustered</em> fail-safe broadcast messaging in an Oracle Weblogic environment, do yourself a favour and use Coherence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Come back Gavin King, all is forgiven (Spring is the new EJB 2.1)</title>
		<link>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/</link>
		<comments>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 12:38:47 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[poorly attempted humour]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=600</guid>
		<description><![CDATA[I&#8217;ve just spent the past two days trying to make Spring transaction management work with JPA-annotated Hibernate-backed persistence classes that need to have multiple persistence units with transaction propagation REQUIRES_NEW between the two. For a start, the documentation is merely a series of outlines of brief hints. One measly section.The laughably short Spring 3 doco [...]]]></description>
			<content:encoded><![CDATA[<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} -->I&#8217;ve just spent the past <em>two days </em>trying to make Spring transaction management work with JPA-annotated Hibernate-backed persistence classes that need to have multiple persistence units with transaction propagation REQUIRES_NEW between the two.</p>
<p>For a start, the documentation is merely a series of outlines of brief hints. One measly section.The laughably short Spring 3 doco section 13.5.1.4 &#8220;Dealing with multiple persistence units&#8221; conveniently omits  the transaction manager configuration from the example. The problem appears to be that the JPA transaction manager only (and compulsorily) deals with <em>one</em> entity manager factory. And an entity manager factory only deals with <em>one</em> persistence unit. So therefore you have to have <em>two</em> JPA transaction managers. Which means the two persistence unit transactions won&#8217;t co-operate properly even though they may share the underlying datasource and are configured through the single persistence unit manager bean.</p>
<p>The above scenario is totally trivial in an EJB 3 container backed with Hibernate, or Eclipselink, as the provider. About one-quarter of the configuration. If I have to use a JTA transaction manager obtained by JNDI lookup from the container, to run a transaction across two JPA persistence units which share the same underlying datasource, why the hell am I using Spring in the first place?</p>
<p>All I wanted was to isolate one set of db transactions from another, use JPA persistence units so the two sets of tables could live easily in two different schemas, and use the annotations to kill the fragile AOP regex-like-but-not-like-regex class and method pattern-matching jiggery pokery from the Spring configuration.</p>
<p>My god, this is such a stonkingly non-trivial forest of horrible configuration and a trial and error morass of filthy swamp miasma &#8230; an equivalent EJB3 backed by Hibernate JPA set up is, by comparison, an almost effortless task. I can produce a unit-tested all singing all dancing multiple persistence unit JPA app running in an EJB 3 container with XA datasources using Hibernate as the JPA implementation in almost no time at all. Getting the same thing with Spring (oh, and running some tests with Jetty inside Maven) is like having all your teeth pulled while you&#8217;re coming down from a three day methamphetamine binge. Getting Spring to run with multiple JPA persistence units on the same JDBC connection (without XA, across the same database connection) with a transaction propagation of REQUIRES_NEW on the entry point of one of the units is a hair-pulling, beard-greying, head-desk banging, co-worker punching, drunken ranting, blood-pressure raising experience of pure horror. Which apparently doesn&#8217;t end.</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} -->Die, Spring, die. Can&#8217;t come soon enough as far as I am concerned. It&#8217;s more evil than Oracle. At least you <em>know</em> with Oracle you&#8217;re in for an un-lubed hard and fast backdoor job from Ellison with no reach-around before you even unpack the box. Spring is like a beautiful young sexy soft-porn film that turns into some relentlessly horrific succubus-filled horror film half way through.</p>
<p>Seriously, its enough to make one pine for bloody Weblogic. Spring is the new EJB 2.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>REST and SOA and Agile and Waterfall</title>
		<link>http://www.crazymcphee.net/x/2010/12/21/rest-and-soa-and-agile-and-waterfall/</link>
		<comments>http://www.crazymcphee.net/x/2010/12/21/rest-and-soa-and-agile-and-waterfall/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 08:26:07 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=595</guid>
		<description><![CDATA[Recently I&#8217;ve been working on two projects. They are an exercise in contrasts. First the technologies and the development methodologies. So the first company uses a very Waterfall process and the integration platform is SOA. We&#8217;ve managed to build, in the middle of this, a small and focussed Java component that uses JMS in and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been working on two projects. They are an exercise in contrasts.</p>
<p>First the technologies and the development methodologies.</p>
<p>So the first company uses a very Waterfall process and the integration platform is SOA. We&#8217;ve managed to build, in the middle of this, a small and focussed Java component that uses JMS in and out to avoid building horrible <em>horrible</em> BPEL or BPMN etc. But at either end, there&#8217;s some SOA bits to manage the integration with the &#8220;legacy&#8221;. So we&#8217;ve got this great bit of software, does amazing things, delivers real value to the business, which they want to put into production asap, but at every turn we&#8217;re hampered by the organisation or the technology platform. Its not so much the technology platform but the waterfall process the company has put around it. I&#8217;ve been told an internal wiki article detailing all the JMS  configuration is not  acceptable and the detail had to be in a Word document attached to an email requesting a not-production server configuration change. Word documents attached to emails are apparently far more &#8220;controllable&#8221; than a wiki with strong authentication protocols and history details in this world-view. Naturally I cut and pasted my wiki configuration detail into a Word document, spent a morning formatting it, and even added a link to the wiki before attaching it to an email. Acceptable process; configuration delivered. SOA and waterfall go together to make software development hell.</p>
<p>The second project has its many issues but one thing it does not have (for the components I have designed at least) is any SOA. It is all REST all the way down. There are multiple server-side-only components that all communicate to each other with REST over HTTP. Some of the data passed between servers is (or soon will be) JSON. The user interface is about to be delivered in two parts &#8211; one through actual REST-inspired web page requests to get the HTML and the other, via JQuery running on the web pages to actual JSON over REST services. These services will also call the REST services on the other components of the system (no database at the UI level). In fact many of the same JSON documents will be used to communicate from server to server as from ui to server. We are using Jersey for the REST. The process is Agile. The organisation hasn&#8217;t delivered such a large project with Agile before, and while I&#8217;ve been away on the other project there&#8217;s been some loss of focus. But despite some critical moments we had last week there&#8217;s been a renewed commitment to improving the engineering and project processes to achieve high velocity and good success. Its not perfect but it feels like the senior managers want the agile process to succeed. So, REST and Agile go together to make developer success.</p>
<p>Now, to the organisations. See if you can match the organisational description to the project style.</p>
<p>One of these two projects is a really fascinating piece of software in the transport industry (I can&#8217;t say more than that) which is integrating a number of &#8220;old&#8221; software solutions and creating some really sexy new features that the customer wants and loves. It is across what Eric Evans calls the &#8220;core domain&#8221; of the business. Not only is it a relatively short piece of work, but it will deliver high value to the business. It also enables a bunch of even higher value business services in the future. Things that directly expand their capabilities they can offer to their customers (which will be many of my readers) and do other related sexy things core to the business. The business salivate over it. It buffs their shine. They want it.</p>
<p>The other project is a little less flashy. The product is a rather niche product but it&#8217;s purpose is around the environmental effects of carbon emissions so at it&#8217;s core is the mission &#8220;save the planet from CO2&#8243; &#8212; a pretty high value mission you&#8217;d think. However the actual functions of the software product are fairly mundane &#8211; based around helping large organisations capture and control data about their carbon emissions, because many of them have been required now to report these numbers to government agencies for a number of years. It has customers, all of then big companies or government agencies, and all the future prospects are similar sorts of organisations.</p>
<p>Which one is which? Which one uses REST/Agile, and which one is the SOA/Waterfall project? Do you think you can guess?</p>
<p>Would you be surprised if I said that the &#8220;sexy&#8221; transport project is the first one (SOA/Waterfall) and the second one is the REST/Agile project?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2010/12/21/rest-and-soa-and-agile-and-waterfall/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Stuff that is just plain wrong, part 1,893,567</title>
		<link>http://www.crazymcphee.net/x/2010/11/05/stuff-that-is-just-plain-wrong-part-1893567/</link>
		<comments>http://www.crazymcphee.net/x/2010/11/05/stuff-that-is-just-plain-wrong-part-1893567/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 23:04:19 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[poorly attempted humour]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=591</guid>
		<description><![CDATA[Weblogic&#8217;s a big, vendor-supported, application server right? And it has advanced clustering features, right? So you&#8217;d think it&#8217;s clustered JMS implementation is one of the best in the business &#8212; after all large enterprise systems often require high capacity and reliable clustered messaging, right? And Weblogic is offered as a solution to those sorts of [...]]]></description>
			<content:encoded><![CDATA[<p>Weblogic&#8217;s a big, vendor-supported, application server right? And it has <em>advanced</em> clustering features, right? So you&#8217;d think it&#8217;s clustered JMS implementation is one of the best in the business &#8212; after all large enterprise systems often require high capacity and reliable clustered messaging, right? And Weblogic is offered as a solution to those sorts of problems with all it&#8217;s additional high-priced enterprise-grade products that run on it, right?</p>
<p>Well, <em>nope</em>.</p>
<p><em>Especially</em> nope if you hope to use clustered broadcast messaging (i.e. Topics)  to multiple connected clustered application receivers. Unless you cope with multiple versions of the same message in your application code.</p>
<p>Funny thing is, they <em>already</em> have this product that can do clustered broadcast messaging well proper, it&#8217;s called Coherence. But if you need the JMS API, not so suitable. However they could use this product to underpin their crappy 10 year old clustered JMS implementation in Weblogic. Do you think they will do that? Anyone want to open a book on it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2010/11/05/stuff-that-is-just-plain-wrong-part-1893567/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ordeal of Installing Oracle Service Bus on a Windows-based developer workstation</title>
		<link>http://www.crazymcphee.net/x/2010/07/12/the-ordeal-of-installing-oracle-service-bus-on-a-windows-based-developer-workstation/</link>
		<comments>http://www.crazymcphee.net/x/2010/07/12/the-ordeal-of-installing-oracle-service-bus-on-a-windows-based-developer-workstation/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 07:30:12 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[osb]]></category>
		<category><![CDATA[poorly attempted humour]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[weblogic]]></category>
		<category><![CDATA[wizards considered harmful]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=570</guid>
		<description><![CDATA[This is a genuine installation procedure which I wrote, but you might want to read it for its other values. Overview OSB installation in a development environment consists of a completely separate Weblogic instance and yet another &#8216;special installation&#8217; of Eclipse. You can&#8217;t use existing Eclipse installations. Nor is it recommend to use one of [...]]]></description>
			<content:encoded><![CDATA[<p>This is a genuine installation procedure which I wrote, but you might want to read it for its other values.</p>
<h2>Overview</h2>
<p>OSB installation in a development environment consists of a completely separate Weblogic instance and yet another &#8216;special installation&#8217; of Eclipse. You can&#8217;t use existing Eclipse installations. Nor is it recommend to use one of the five other existing Weblogic instances that Oracle products thoughtfully demand their own copy thereof (SOA Suite, I am looking at you).</p>
<h2>Installation process</h2>
<p>This is the procedure for installing OSB development environment.</p>
<p>As network firewall policy prevents the downloading of files, you will need to use installation media located within &lt;companyname&gt; network. Take the files conveniently stored on network server &lt;location redacted&gt; and copy them into a directory on your local computer. This directory is hereafter referred to as &#8216;installation files directory&#8217; below.</p>
<h3>Install Weblogic</h3>
<ol>
<li>Go to the installation files directory.</li>
<li>Run the executable file wls1033_oepe111150_win32.exe</li>
<li>This action launches the Oracle Installer for the Weblogic instance. It takes some time to run so contemplate the meaning of your life for a few minutes while it does. Maybe get a cup of tea. Stretch your legs. Think about lunch or your next holiday. File a support request for more memory. You should get at least 8GB.</li>
<li>Okay that&#8217;s it, you&#8217;ll finally see the Oracle Weblogic 10.3.3.0 installer. Think about the fact that Oracle sees fit to put &#8220;instructions&#8221; on the first screen telling you what the &#8220;Next&#8221; button does. This is advanced JEE server technology you&#8217;re installing, and potentially, Oracle think you don&#8217;t know what the &#8220;Next&#8221; button does. Maybe this reflects the level of experience inside Oracle, or perhaps it is indicative of the depth of respect in which Oracle holds their customers.</li>
<li>Press the &#8220;Next&#8221; button. The next screen you will see  is very important. If you fsck it up you&#8217;ll have to uninstall and start over. It does not have any instructions, but that&#8217;s OK, we&#8217;ve done it here in this wiki page for you. Pay attention.</li>
<li><strong>DO. NOT. ACCEPT. THE. DEFAULT.</strong> Especially if you installed SOA Suite or some other Oracle product before you installed this one. Double especially if you still want that product to work.</li>
<li>SELECT &#8220;Create a new Middleware Home&#8221; (THIS IS VERY IMPORTANT)</li>
<li>TYPE a name of an Appropriate Directory. I used &#8220;C:\Oracle\OSB_Middleware&#8221;</li>
<li>PRESS The &#8220;Next&#8221; button. Use the &#8220;Back&#8221; button if you need to see the instructions about how to use the &#8220;Next&#8221; button that Oracle conveniently provided for you on the first Screen. No, don&#8217;t do that. If you do that you&#8217;ll probably have to do this proceedure again and it will just make this entire experience last longer than it needs to. This is not a recommended practice.</li>
<li>The next screen demands that you give Oracle your Email Address to get &#8220;security updates&#8221;. It also wants a thing called your &#8220;My Oracle Support Password&#8221; (I suspect this is what might have been known as Oracle TechNet). As we both know, the best possible security measure is not to give out your password to strange programs that demand it.</li>
<li>As I planned on giving them my &lt;workcompany&gt; email, and as my Technet sub doesn&#8217;t use that Email address, I also unchecked the &#8220;I wish to receive security updated via My Oracle Support&#8221; check box.</li>
<li>Are you Sure? YES I&#8217;M VERY SURE. I would like to be &#8220;ignorant of security updates&#8221; and also Oracle spam. Ignorance is Bliss.</li>
<li>Look at that, I can&#8217;t give them my email address after all, what they really meant was &#8220;type your Oracle Support user id&#8221;. Press &#8220;Next&#8221;.</li>
<li>Now you have to choose whether you want a &#8220;Typical&#8221; installation or a &#8220;Custom&#8221; one. I chose &#8220;Typical&#8221;, which, being an Oracle installation, I expect to require an 8-core 64GB RAM 2TB SAN SSD -based supercomputer with a external 4-way Oracle RAC for configuration (&#8220;infrastructure&#8221;) DB in order to have enough grunt to service about 3 requests a minute. Press &#8220;Next&#8221;.</li>
<li>There&#8217;s a lot of choices here about the various subdirectories under the Middleware Home Directory that you created further back. I recommend accepting the defaults, but you can probably cause yourself countless of fun trolling on the My Oracle Support forums as you get ever-more-desparate for a solution to a very obscure problem that the phone support have no idea about and that was likely caused by you mucking about these defaults, causing the support personel to simply recommend you to reinstall the product, if you really feel the need to change them here.</li>
<li>If you can remember the instruction about the use of the &#8220;Next&#8221; button at step 4, then Press &#8220;Next&#8221;.</li>
<li>Now you can choose whether you want to put the shortcuts for &#8220;All users&#8221; or just you (&#8220;Local user&#8221;). If you are the BOFH I recommend &#8220;All Users&#8221;. As this is the default, we can all safely assume that the BOFH works for Oracle and is now responsible for designing their installation processes. Accept the default, and press &#8220;Next&#8221;.</li>
<li>The next screen is a summary of what you&#8217;ll be installing. You can also select each item and see a summary of what it does. Ponder the mystery of Oracle, and press &#8220;Next&#8221;.</li>
<li>Keep pondering that mystery while Oracle Weblogic Server 11g Release 1 (10.3.3.0) is installed. It takes a little bit of time. While it does that, you might to book that Holiday, get another cup of tea, or chase up that support request for the additional RAM you&#8217;ll be soon needing.</li>
<li>Congratulations! Installation is complete.</li>
<li>I opted to leave the &#8220;Run Quickstart&#8221; option checked.</li>
<li>Press &#8220;Done&#8221;. There are no onscreen instructions for this button.</li>
<li>Quickstart will run. It&#8217;s just a link farm.</li>
</ol>
<h3>Install Oracle Enterprise Pack for Eclipse (OEPE aka &#8220;Special Eclipse&#8221;)</h3>
<ol>
<li>Go to the installation files directory</li>
<li>Extract the file oepe-galileo-all-in-one-11.1.1.5.0.201003170852-win32.zip &#8230; I used 7zip and made sure to put it into a subdirectory of the installation files directory.</li>
<li>It&#8217;s kind of pretty big, takes a cople of minutes.</li>
<li>Just like a regular version of Eclipse, once this is unzipped, it&#8217;s installed. However it&#8217;s not a regular version of Eclipse. It is a &#8220;special&#8221; Eclipse that went to &#8220;special&#8221; school.</li>
<li>Although this directory can <em>probably</em> live anywhere, it&#8217;s a good idea to copy this directory into the new Oracle Middleware Home that you created when you installed Weblogic. Look I really have no idea why this is the case, however, it&#8217;s not good to anger the Oracle by using you regular development directories. ORACLE_HOME sweet ORACLE_HOME it is then.</li>
</ol>
<h3>Install OSB and OSB Dev Tools</h3>
<ol>
<li>Go to the installation files directory.</li>
<li>Extract the file ofm_osb_generic_11.1.1.3.0_disk1_1of1.zip &#8230; again I used 7zip and made sure to put it into a directory underneath the installation files directory.</li>
<li>Enter this directory. Enter the directory &#8220;osb&#8221; that will be created underneath it. Note that even though the file said &#8220;disk1_1of1&#8243; in the file name that underneath here there&#8217;s two directories, Disk1 and Disk2.</li>
<li>Go into the directory &#8220;Disk1&#8243;</li>
<li>Run the executable file &#8220;setup.exe&#8221;</li>
<li>A DOS window opens which asks you for the location of a JRE in order to use Oracle Universal Installer. Probably. Exactly why the Weblogic installer didn&#8217;t need to know where the JDK was, I do not know. Probably it used a sensible installer rather then the Oracle Universal Installer. I don&#8217;t ever think I&#8217;ve ever seen an machine with two Oracle installations on it that didn&#8217;t also have two or more installations of the Oracle Universal Installer also installed on it. Its name perhaps means that it installs itself universally, rather than it is a product which has a universal use for installing other software. Ponder the mystery of the Oracle.</li>
<li>A JRE will be located in the original Oracle Middleware Home that you created when you installed Weblogic. In fact there&#8217;s at least two (Sun JDK and JRockit). Use the Sun JDK. For example, my value for the JDK was &#8220;C:\Oracle\OSB_Middleware\jdk160_18&#8243;. Press Enter.</li>
<li>Now the Universal Installer will actually attempt to install something. It says &#8220;You are about to install the Oracle Service Bus (OSB) and may install the Oracle Service Bus IDE and Oracle Service Bus Examples (OSBE). Before proceeding, make sure that you have installed and configured Oracle WebLogic Server 11g. If you want to design OSB applications in Eclipse, make sure Oracle Enterprise Package for Eclipse (OEPE) is installed.&#8221; Which is all true if you&#8217;ve been following this guide.</li>
<li>Press &#8220;Next&#8221;. There&#8217;s no instructions in this program for the use of the &#8220;Next&#8221; button. Someone ought to file a change request for that.</li>
<li>Now you can choose whether you want a &#8220;Typical&#8221; installation or a &#8220;Custom&#8221; one. Typically, choose &#8220;Typical&#8221;.</li>
<li>Press &#8220;Next&#8221;. I tried looking for online help here about the use of the &#8220;Next&#8221; button but I did not find anything.</li>
<li>It does a prerequisite check. It should pass, and if it doesn&#8217;t, you are probably screwed. If it does, you will be able to Press &#8220;Next&#8221;</li>
<li>At this next screen <strong>DO NOT ACCEPT THE DEFAULTS</strong>.</li>
<li>Choose the Oracle Middleware Home that you installed the Weblogic into at the first part of this installation procedure. E.g. I chose &#8220;C:\Oracle\OSB_Middleware&#8221;.</li>
<li>Once you do the previous step, ff you followed the instructions for the Special Eclipse (OEPE), it will have found it automatically. If not, choose the location where you installed the Special Eclipse (OEPE Location). For example, my value was &#8220;C:\Oracle\OSB_Middleware\oepe-galileo-all-in-one-11.1.1.5.0.201003170852-win32&#8243;</li>
<li>Press &#8220;Next&#8221;. Did you know that the Oracle at Delphi was a priestess called the &#8216;Pythoness&#8217; who answered your question using gibberish verse. A Male Attendant of the Pythoness interpreted her raving mad gibberings and told you what they meant. For a fee. Does this sound familiar?</li>
<li>Review the installation details. When you are sure they are correct, press &#8220;Install&#8221;.</li>
<li>OSB will now install. It takes a little time so run those errands, go to lunch, get a coffee, dream of the Holiday you just Booked. I&#8217;d tell you to install the new 8GB of memory that you ordered before which surely has arrived by now, but that would mean turning your computer off. Best to wait until it&#8217;s finished then.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2010/07/12/the-ordeal-of-installing-oracle-service-bus-on-a-windows-based-developer-workstation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

