<?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>Schauderhaft</title>
	<atom:link href="http://blog.schauderhaft.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.schauderhaft.de</link>
	<description>Softwaredevelopment, Projectmanagement, Qualitymanagement and all things &#34;schauderhaft&#34;</description>
	<lastBuildDate>Sat, 28 Aug 2010 08:25:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Biweekly Scrummy Scrum</title>
		<link>http://blog.schauderhaft.de/2010/08/28/biweekly-scrummy-scrum/</link>
		<comments>http://blog.schauderhaft.de/2010/08/28/biweekly-scrummy-scrum/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 08:25:11 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=592</guid>
		<description><![CDATA[At LINEAS we currently run our first three Scrum projects. I am one of the three Scrum Masters. Unfortunatly we don&#8217;t have much experience with Scrum. Actually we only knew it from books, and this weird thing called internet, before we started. So there are lots of questions we have and only few who we [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">At <a href="http://www.lineas.de">LINEAS</a> we currently run our first three Scrum projects. I am one of the three Scrum Masters. Unfortunatly we don&#8217;t have much experience with Scrum. Actually we only knew it from books, and this weird thing called internet, before we started. So there are lots of questions we have and only few who we can ask. Thats why we invented the</p>
<p><strong>Biweekly Scrummy Scrum</strong></p>
<p>Its inspired by the daily Scrum of a normal Scrum project but happens as you might have guessed every other week. The purpose of this short meeting is to exchange problems and ideas for their resolution and so far it works really well. Although it is really not much time we invest we learn a lot.</p>
<p>It is open to everybody interested in Scrum and it is limited in it time frame. It starts right before the lunch break, so there is a strong incentive for not letting it run to long. So far we don&#8217;t use a fixed structure. It is more like an open discussion group. Maybe in the future when we all have somewhat settled for a basic implementation of Scrum we&#8217;ll use a more strict structure, where everybody reports about her problems, possible fixes are discussed and a plan is formed about what to do about the problem until the next meeting.</p>
<p>You might think it is a Scrum of Scrums as described in many book, but I don&#8217;t think so since the teams involved are completely independent and don&#8217;t work on the same or related projects. Also it isn&#8217;t only for scrum masters, but for everybody interested. If comparable at all it is more like an Improvement Community as described in<a href="http://www.amazon.com/gp/product/0321579364?ie=UTF8&amp;tag=schauderhaft-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321579364"> Succeeding with Agile</a>, which is a group interested in a certain kind of change, working together in order to support that change. But so far we don&#8217;t have an improvement backlog, but maybe that would be a great idea.</p>
<p>What do you to improve you agile/scrum/kanban or projectmanagement skills inside your company?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/08/28/biweekly-scrummy-scrum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>One Database for Every Developer</title>
		<link>http://blog.schauderhaft.de/2010/08/22/one-database-for-every-developer/</link>
		<comments>http://blog.schauderhaft.de/2010/08/22/one-database-for-every-developer/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 08:16:24 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Softwaredevelopment]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=457</guid>
		<description><![CDATA[How many databases run in your teams development environment? One for the complete team? I have seen many places like that, but please tell me: Why? You aren&#8217;t working on a shared files system aren&#8217;t you? How is a developer supposed to change the structure of that database without interrupting the work of the other [...]]]></description>
			<content:encoded><![CDATA[<p>How many databases run in your teams development environment? One for the complete team? I have seen many places like that, but please tell me: Why? You aren&#8217;t working on a shared files system aren&#8217;t you? How is a developer supposed to change the structure of that database without interrupting the work of the other developers? And just in case you haven&#8217;t noticed: Pretty much every RDBMS vendor offers free versions of their database which can run on a developer machine.</p>
<p>So when you answered the second question above with &#8216;yes&#8217; you have a task for tomorrow: Make sure every developer has her own database instance (or schema or whatever you need to work independently from the rest of the team). In addition to that: you need an instance for the automatic tests of your Continuous Integration system, one large one for performance and scalability tests, one for manual tests/integration and of course one for production.</p>
<p>And just in case you are now thinking: &#8220;Hell how am I supposed to keep all these databases in sync?&#8221; You are having a gapping hole in your software development process. I&#8217;ll cover that in a different post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/08/22/one-database-for-every-developer/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Use Cases for JUnit Rules</title>
		<link>http://blog.schauderhaft.de/2010/08/15/use-cases-for-junit-rules/</link>
		<comments>http://blog.schauderhaft.de/2010/08/15/use-cases-for-junit-rules/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 08:12:25 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Softwaredevelopment]]></category>
		<category><![CDATA[edt]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[Rule]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=581</guid>
		<description><![CDATA[Sometime ago I blogged about JUnit @Rule Annotation. In the meantime I got the chance to use rules in a real project. I must say: Rules rock! Let me tell you about my use cases. I am working on a Swing project (It&#8217;s OK, it&#8217;s not as bad as it sounds). We have many tests [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime ago I blogged about <a href="/2009/10/04/junit-rules/">JUnit @Rule Annotation</a>. In the meantime I got the chance to use rules in a real project. I must say: Rules rock! Let me tell you about my use cases.</p>
<ul>
<li>I am working on a Swing project (It&#8217;s OK, it&#8217;s not as bad as it sounds). We have many tests that create components and check certain properties. Although they never get shown in the traditional sense, Swing documentation requires all manipulation of Swing Components to happen in the Event Dispatch Thread. We have an EDTRule, which runs every test using SwingUtilities.invokeAndWait(). It works like a charm. We actually had a dozen tests that would fail under real weird conditions, which behave nicely since they where adorned with an EDTRule. While the Rule takes care on the threading requirements, test stay nicely clean and don&#8217;t get poluted by SwingUtilities and Runnable implementations.</li>
<li>Another class of tests runs scripts against a database. In order to reproduce what the database admins will do, we use SQL/Plus for this (If you don&#8217;t know SQL/Plus consider yourself lucky). One problem with these test is, that a small bug in a script might cause SQL/Plus to await user input. In order to prevent the test to hang forever we implemented a TimeoutRule. Each script that gets started puts its <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html">Process</a> instance into the rule instance, and the rule instance will <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html#destroy%28%29">destroy the Process</a> after some specified time. Note: JUnit comes with a similar <a href="http://kentbeck.github.com/junit/javadoc/latest/org/junit/rules/Timeout.html">Timeout rule</a>, which will let the test fail after a timeout.</li>
<li>We have an ApplicationRegistry, which is basically a singleton map containing Implementations for Interfaces. Each test should setup the ApplicationRegistry with whatever is needed, and clean it up afterwards. Often developers forget the last part (When I say developers I am talking about myself). For this we have an ApplicationRegistryRule. It cleans the ApplicationRegistry before the test and after the test. Since it is only one Rule instead of a Before and an After method, it is easier not to forget one half of it. But the Rule does more: Before cleaning it, it checks if the ApplicationRegistry is empty. If it isn&#8217;t this means, some other test left it dirty. In this case the Rule calls Assertion.fail(). This way we found (probably) every test which left the ApplicationRegistry dirty. Very cool. A similar approach should work for other central resources like Spring Contexts and the like.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/08/15/use-cases-for-junit-rules/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Kill Projects</title>
		<link>http://blog.schauderhaft.de/2010/08/09/how-to-kill-projects/</link>
		<comments>http://blog.schauderhaft.de/2010/08/09/how-to-kill-projects/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 04:46:43 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[budget]]></category>
		<category><![CDATA[kick off]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=560</guid>
		<description><![CDATA[When looking at the project kick-off process of some companies you really start wondering, what the heck are they up to? These processes I am talking about look like this: Come up with an idea (I like that process step) Prepare a cost estimate and a business plan for the project Present these to a [...]]]></description>
			<content:encoded><![CDATA[<p>When looking at the project kick-off process of some companies you really start wondering, what the heck are they up to?</p>
<p>These processes I am talking about look like this:</p>
<ol>
<li>Come up with an idea (I like that process step)</li>
<li>Prepare a cost estimate and a business plan for the project</li>
<li>Present these to a committee</li>
<li>Update the documents from step 2. based on the feedback from step 3. (Its said that many comments are like &#8216;there should be a company logo on the title page&#8217; or &#8216;you really shouldn&#8217;t center align the page numbers&#8217;)</li>
<li>Present these to another committee which will decide on the funding of the project.</li>
</ol>
<p>While this might be of some value of for large projects, it will kill small projects and put medium into trouble right from the beginning. For smaller projects the overhead of the approval process will not only delay the project  and increase the cost by a considerable amount of money. It will also kill of any motivation of anybody in favor of the project.</p>
<p>But it is even worse for large projects. Since once the project ha the approval, who will be inclined to question the project? Of course everybody will be bickering about the stupid idea the project is. But who does step up and says: &#8220;You know maybe the guys in control of my salary and career made a mistake and we simply should buy an of the shelve product for 1% of the money?&#8221; Correct: No one. The task of questioning the purpose of a project is done by someone else.</p>
<p>This would be OK, if the committee is in a better position to judge these decisions. But it isn&#8217;t it has the information of one person, carefully crafted for making sure the decision is made in favor of that person. You might assume just as well, they don&#8217;t have any information at all.</p>
<p>How about an approach like this: Give every employee a budget. Top people might get a bigger budget. Employees might invest into a project, or keep the budget. A percentage of the budget left over at the end of the year would get payed the employee. Another percentage would get added to the budget of the next year. When invested into a project, the investing employees get a certain part of the ROI of that project.</p>
<p>Certainly not the best solution. But certainly better then what is going on in companies right now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/08/09/how-to-kill-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Persistent</title>
		<link>http://blog.schauderhaft.de/2010/07/25/be-persistent/</link>
		<comments>http://blog.schauderhaft.de/2010/07/25/be-persistent/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 14:04:18 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[The Rest]]></category>
		<category><![CDATA[change]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=574</guid>
		<description><![CDATA[If you want to change yourself, you might be able to do it within 5 minutes. But if you want to change an organization change needs time. Even when you are the CEO, change doesn&#8217;t happen because you announced it on a big meeting. But If you push towards change, If you don&#8217;t give up, [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to change yourself, you might be able to do it within 5 minutes. But if you want to change an organization change needs time. Even when you are the CEO, change doesn&#8217;t happen because you announced it on a big meeting. But</p>
<p>If you push towards change,</p>
<p>If you don&#8217;t give up,</p>
<p>If you try over and over again,</p>
<p>If you try different approaches,</p>
<p>If you talk to everyone who lets you talk,</p>
<p>someday change will happen no matter what your official title is.</p>
<p>Be persistent if the cause is worth it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/07/25/be-persistent/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Properties of a Good Unit Tests</title>
		<link>http://blog.schauderhaft.de/2010/07/18/properties-of-a-good-unit-tests/</link>
		<comments>http://blog.schauderhaft.de/2010/07/18/properties-of-a-good-unit-tests/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 04:03:07 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Softwaredevelopment]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=556</guid>
		<description><![CDATA[Question: what are the properties which make a test a good unit test? If you have a good answer, check out my answer and add to it in the comments. If you don&#8217;t here is mine. Long Descriptive Name: For example returnsNullWhenCalledOnEmptyList is a nice name for a test Simple Clean Structure: A test performs [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> what are the properties which make a test a good unit test? If you have a good answer, check out my answer and add to it in the comments. If you don&#8217;t here is mine.</p>
<p><strong>Long Descriptive Name:</strong> For example <tt>returnsNullWhenCalledOnEmptyList</tt> is a nice name for a test</p>
<p><strong>Simple Clean Structure:</strong> A test performs necessary setup, executes the method to be tested and performs its assertions. Not more not less </p>
<p><strong>Fast:</strong> one thousand tests should run in less than a minute. This allows an extensive test suite to run often during development. If your tests are slower, you might be doing integration tests.</p>
<p><strong>Test a Single Feature or behavior:</strong> This is sometimes phrased as &#8216;one assertion&#8217;, which I consider misleading. If you need multiple assertion in order to assert one behavior thats OK, although you might consider a new assert method for that. </p>
<p><strong>Reliable:</strong> For the same code base a test should produce the same result every time. A test that fails every 10th time will fail for a real bug and you won&#8217;t know it.</p>
<p><strong>Stable:</strong> The test only fails, when the code under test doesn&#8217;t behave as expected, not because anything else changed.</p>
<p><strong>Easy to Understand:</strong> Just as normal code, the intention of a test should be easy to understand. Names help with this. Extracting setup code in a properly named method helps as well.</p>
<p><strong>Should Not Use Production Classes, Except The Class Under Test:</strong> This helps with the &#8216;Stable&#8217; and the &#8216;Fast&#8217; property. It&#8217;s ok to use simple classes like String or Integer.</p>
<p><strong>Don&#8217;t Try to Squeeze All Tests for a Class in a Single Test Class:</strong> For many classes you will have more then one test class. The different test classes will probably differ in the setup needed for the contained tests.</p>
<p><strong>Independent:</strong> No Test should depend on any other Test or on the order of execution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/07/18/properties-of-a-good-unit-tests/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>An Analysis of NonUniqueObjectException and LazyInitializationException in Hibernate</title>
		<link>http://blog.schauderhaft.de/2010/07/11/an-analysis-of-nonuniqueobjectexception-and-lazyinitializationexception-in-hibernate/</link>
		<comments>http://blog.schauderhaft.de/2010/07/11/an-analysis-of-nonuniqueobjectexception-and-lazyinitializationexception-in-hibernate/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 19:25:19 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Softwaredevelopment]]></category>
		<category><![CDATA[domain driven design]]></category>
		<category><![CDATA[hibernate]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=529</guid>
		<description><![CDATA[I consider Hibernate a great and useful tool. But it has some mean Exceptions lurking in the darker corners. Today I&#8217;d like to explore the ones from the title in a little more detail, including different approaches on how to avoid them. Let&#8217;s start with the well known LazyInitializationException. When you search for this one [...]]]></description>
			<content:encoded><![CDATA[<p>I consider Hibernate a great and useful tool. But it has some mean Exceptions lurking in the darker corners. Today I&#8217;d like to explore the ones from the title in a little more detail, including different approaches on how to avoid them.</p>
<p>Let&#8217;s start with the well known <tt>LazyInitializationException</tt>. When you search for this one in the Internet you end up with scenarios like this one:</p>
<p>You load <tt>A</tt>, close the session you  used and try to access a property of <tt>A</tt> which gets loaded lazily resulting in a <tt>LazyInitializationException</tt>. That one is well described, including strategies to avoid it, which basically consist of not closing the session to early.</p>
<p>But there are more hideous scenarios. Assume the classes Mom, Dad and Kid are mapped as one would expect, with references from Mom and Dad to Kid. Now consider the following piece of code:</p>
<div class="geshi no java">
<ol>
<li class="li1">
<div class="de1">Session session = openSession<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">session.<span class="me1">beginTransaction</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">Mom mom = <span class="br0">&#40;</span>Mom<span class="br0">&#41;</span> session.<span class="me1">load</span><span class="br0">&#40;</span>Mom.<span class="kw2">class</span>, momId<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">Kid momsKid = mom.<span class="me1">getKid</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// dad comes by</span></div>
</li>
<li class="li1">
<div class="de1">Dad dad = <span class="br0">&#40;</span>Dad<span class="br0">&#41;</span> session.<span class="me1">load</span><span class="br0">&#40;</span>Dad.<span class="kw2">class</span>, dadId<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">Kid dadsKid = dad.<span class="me1">getKid</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// and leaves</span></div>
</li>
<li class="li1">
<div class="de1">session.<span class="me1">evict</span><span class="br0">&#40;</span>dad<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// alas he has taken kido with him</span></div>
</li>
<li class="li1">
<div class="de1">momsKid.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Depending on your exact Mapping you might get a <tt>LazyInitializationException</tt> in the last line, although the session is still open. The problem here is that when dad got evicted the kid got evicted as well. And since Mom has a reference to the exact same object, that object isn&#8217;t attached to any session anymore. In order to see this effect you&#8217;ll have to use mappings like this:</p>
<div class="geshi no java">
<div class="head">@ManyToOne(fetch = LAZY, cascade = CascadeType.ALL)</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Cascade<span class="br0">&#40;</span>org.<span class="me1">hibernate</span>.<span class="me1">annotations</span>.<span class="me1">CascadeType</span>.<span class="me1">ALL</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> Kid kid<span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>The <tt>NonUniqueObjectException</tt> gets caused by what could be considered the reverse process. Examine the following piece of code:</p>
<div class="geshi no java">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Dad left for another woman, I mean Session</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Dad dad = loadDad<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Session session = openSession<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; session.<span class="me1">beginTransaction</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Mom mom = <span class="br0">&#40;</span>Mom<span class="br0">&#41;</span> session.<span class="me1">load</span><span class="br0">&#40;</span>Mom.<span class="kw2">class</span>, momId<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>mom.<span class="me1">getKid</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Now dad wants to move back in</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; session.<span class="me1">saveOrUpdate</span><span class="br0">&#40;</span>dad<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>The first method call loads a <tt>Dad</tt> object including <tt>Kid</tt> from a different session. Then from the &#8216;main&#8217; session <tt>Mom</tt> gets loaded including kid. When we attach the <tt>Dad</tt> object to the session it tries to attach its version of the <tt>Kid</tt> as well, which collides with the <tt>Kid</tt> already present in the session.</p>
<p>So how can we avoid these kind of problem? I see several options:</p>
<ul>
<li>Don&#8217;t use Cascade. Of course this means much more effort on your side in many cases, since you have to carefully track what you need to attach or evict from a session.</li>
<li>Don&#8217;t use <tt>evict</tt> and don&#8217;t reattach existing instances to sessions. I guess this should work in many cases. But I have seen cases where this approach would have caused a large overhead, because reloading complex object graphs.</li>
<li>Carefully design your cascading boundaries. A look at the Aggregate Root from <a href="http://www.amazon.de/gp/product/0321125215?ie=UTF8&#038;tag=schauderhafte-21&#038;linkCode=as2&#038;camp=1638&#038;creative=19454&#038;creativeASIN=0321125215">DDD</a> might help here. An Aggregate Root is a single class which works as a gate keeper (did anybody say facade) to a cluster of classes related to the Aggregate Root. When all the Hibernate related actions go against that Aggregate Root, and cascade from there to the content and only the content of the Aggregate Root you should be safe. All entities outside an Aggregate Root have to use the Aggregate Root or Repositories to gain access. This needs some bookkeeping. But when you do it properly it might actually improve the over all design of your code. Please note that all this is a thought experiment on my side, and I can&#8217;t promise that it actually works as intended, but I think it should.</li>
</ul>
<p>If you want the complete source code for the example, you can download this <a href="/wp-content/uploads/2010/07/sources.zip">source.zip</a> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/07/11/an-analysis-of-nonuniqueobjectexception-and-lazyinitializationexception-in-hibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrum is a Social Thing</title>
		<link>http://blog.schauderhaft.de/2010/07/04/scrum-is-a-social-thing/</link>
		<comments>http://blog.schauderhaft.de/2010/07/04/scrum-is-a-social-thing/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 12:15:36 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[team]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=546</guid>
		<description><![CDATA[I&#8217;m currently involved in my first project using Scrum. As preparation for my role as Scrum Master I read various books on the subject. In there I found one lesson about Scrum and Agile in general, which I consider more important than anything else: Scrum is a Social Thing Scrum is about team building, Scrum [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently involved in my first project using Scrum. As preparation for my role as Scrum Master I read various <a href="/2010/05/30/3-books-agile/">books on the subject</a>. In there I found one lesson about Scrum and Agile in general, which I consider more important than anything else:</p>
<p><strong>Scrum is a Social Thing</strong></p>
<p>Scrum is about team building, Scrum is about the relationship to your customer and the relationship to your users. Let me elaborate, why I think this is the case, and why it is so important for success.</p>
<p>So lets start with some practices of Scrum that are inherently social:</p>
<ul>
<li>The complete Team does the estimates. This makes the estimates more reliable, but possibly more important, it is team building. Everybody in the team makes an estimates, everybody commits to the sprint back log, so noone can go &#8220;I said all the time it doesn&#8217;t work&#8221;. We commit as team so if we don&#8217;t succeed, it is we that failed, not him.</li>
<li>The Product Owner is present during estimates. Of course this is important to provide information about the user stories, but it also means she knows all the discussions going on. So if there is a crucial part that everybody forgot about she can&#8217;t go: You are professionals, you should have known we need this feature as well. If she didn&#8217;t spoke up during planning, she obviously forgot about the important obvious task as well. So everybody is in one boat again.</li>
<li>Tracking impediments makes sure the impediments get out of the way. But it also communicates, that somebody (the Scrum Master) cares about the problems of the team and works hard to make the environment as productive as possible. This makes a big different, even if some impediments can&#8217;t get resolved. Also the team is encouraged to work on the impediments themselves. And trust me, rearranging office furniture together is better then an expensive team building training.</li>
<li>The Product Owner determines what to achieve in terms of business value, but the team decides how to implement that. This makes a big difference in motivation. If you don&#8217;t believe me, get a copy of <a href="http://www.amazon.de/gp/product/1847677681?ie=UTF8&amp;tag=schauderhafte-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=1847677681">&#8220;Drive&#8221; by Daniel H. Pink</a> it will tell you the same.</li>
</ul>
<p>Hopefully I have convinced you that Scrum contains a lot of social engineering in its practices. But why is this important? Because Agile projects today are done with the same people who did waterfall projects last year. The practices of Scrum don&#8217;t make the software development process any better or faster in a direct way. It avoids some waste in the form of irrelevant documentation and features nobody really needs, but when looking at failed projects I don&#8217;t think that little avoided waste would make much of a difference.</p>
<p>But team building does. Motivation does. Compare tasks you enjoy and tasks you love, done with a team you hate or fear or a team thats rightly called so. For me an example would be filing my tax compared to creating software. There is easily a factor of ten in productivity &#8230; so there is a silver bullet. There is a single thing that might boost performance by a factor of (or close to) ten:</p>
<p><strong>Get the team motivated.</strong></p>
<p>Scrum might help you with that. This also explains why Scrum will be done wrong in many cases: You can&#8217;t just apply rules, since rules are a killer for motivation. You have to understand the ideas in scrum, listen to the team and foster the right kind of environment. Then and only then Scrum will increase your chances for success.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/07/04/scrum-is-a-social-thing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Tune a SQL Statement</title>
		<link>http://blog.schauderhaft.de/2010/06/27/how-to-tune-a-sql-statement/</link>
		<comments>http://blog.schauderhaft.de/2010/06/27/how-to-tune-a-sql-statement/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 04:07:03 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[Softwaredevelopment]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=531</guid>
		<description><![CDATA[One of my standard questions I ask when interviewing a candidate with some database or SQL know how is: Assume you have a fairly complex select statement operating on some serious tables (tens of millions of rows). The customer complains the SQL statement is to slow. What options would you consider for tuning such a [...]]]></description>
			<content:encoded><![CDATA[<p>One of my standard questions I ask when interviewing a candidate with some database or SQL know how is:</p>
<blockquote><p>Assume you have a fairly complex select statement operating on some serious tables (tens of millions of rows). The customer complains the SQL statement is to slow. What options would you consider for tuning such a select statement? If it matters assume it is an Oracle database.</p></blockquote>
<p>Just in case you want to apply for a job at a <a href="http://www.lineas.de">LINEAS</a> here is, what I would consider a damn good answer:</p>
<p>First I check if the SQL statement is really slow, for that I&#8217;ll execute the SQL statement with a low level tool (SQL Plus, SQL Developer &#8230;) on the database. I fetch the same amount of rows, as the customer (or his application) does. I do that on the DB machine or one a machine with very good connectivity to the database, in order to take network issues out of the loop. I measure the execution time. If this is as slow as described by the customer, the SQL statement plus DB seem to be the problem. If not probably something else is the problem (network, application logic &#8230;)</p>
<p>I establish a target performance, we need to meet the customer requirements.</p>
<p>I check the execution plan of the statement comparing it with the structure of the schema (tables, indexes, number of rows in tables compared to number of rows actually selected). Are there any obvious problems? For example;</p>
<ul>
<li> Full Table Scans that result only in a small percentage of the rows of that table</li>
<li>Index accesses on a large percentage of rows</li>
<li>Indexes that don&#8217;t get used, although one would expect them to</li>
<li>Identical expensive pieces of the execution plan, on different places  of the execution plan</li>
<li>Estimated number of rows in the execution plan that differ significantly from the actual number of rows returned</li>
</ul>
<p>Depending on what I find I would try some of the following actions, to improve performance</p>
<ul>
<li>gather statistics</li>
<li>create an additional index supporting the where clauses used in the statement</li>
<li>add columns to an index, in order to remove the need for additional table accesses</li>
<li>use hints to force certain execution plans</li>
<li>exchange (not) in with (not) exists and vice versa</li>
<li>rearrange the select statement (e.g. turn a union of  joins into a join of union)</li>
<li>partitioning of tables and indexes</li>
<li>use materialized views</li>
<li>in very special cases use bitmap indexes or dimensions</li>
</ul>
<p>With these options the performance of most of the &#8216;slow&#8217; statements I encountered so far could get brought to acceptable levels. Often improving performance by multiple orders of magnitude. When I am able to identify the problem, but not the solution <a href="http://asktom.oracle.com/pls/apex/f?p=100:1:0">Ask Tom</a> is what I would do next.</p>
<p>There is one answer I get very often, which I consider pretty bad, if it comes without further comment:</p>
<blockquote><p>Replace outer joins with inner joins</p></blockquote>
<p>Outer joins have a different meaning than inner joins. Normally you can&#8217;t replace one for the other. If you actually can, I&#8217;d consider using an outer join a bug, so replacing it with an inner join is bug fixing, not tuning.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/06/27/how-to-tune-a-sql-statement/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Possibly the Most Important Skill for Managers, Coaches, Teachers and Parents</title>
		<link>http://blog.schauderhaft.de/2010/06/20/possibly-the-most-important-skill-for-managers-coaches-teachers-and-parents/</link>
		<comments>http://blog.schauderhaft.de/2010/06/20/possibly-the-most-important-skill-for-managers-coaches-teachers-and-parents/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 08:05:22 +0000</pubDate>
		<dc:creator>Jens Schauder</dc:creator>
				<category><![CDATA[The Rest]]></category>
		<category><![CDATA[coaching]]></category>
		<category><![CDATA[Motivation]]></category>

		<guid isPermaLink="false">http://blog.schauderhaft.de/?p=533</guid>
		<description><![CDATA[I am writing this during a chess tournament for kids and I just talked to a mother, which triggered this post. When her son made a mistake which resulted in loss of his queen and as a result loss of the game she said: &#8220;I better don&#8217;t talk to him. I&#8217;d only scold him for [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing this during a chess tournament for kids and I just talked to a mother, which triggered this post.</p>
<p>When her son made a mistake which resulted in loss of his queen and as a result loss of the game she said:</p>
<p>&#8220;I better don&#8217;t talk to him. I&#8217;d only scold him for his mistakes.&#8221;</p>
<p>My immediate answer was:</p>
<p>&#8220;Of course you should talk to your son! You should praise him for the way he played.&#8221;</p>
<p>This resulted in a blank stare.</p>
<p>Is this really so difficult to understand? When somebody makes a mistake, most of the time, they know very well they made a mistake. The chess playing kid knows he lost. He knows losing the queen wasn&#8217;t a smart idea. Often kids know this so well that they start crying. Trust me on this: There is no need to tell them what they did wrong. They&#8217;ll focus their thoughts on the things they did wrong. And this doesn&#8217;t help.</p>
<p>Instead tell them what the did well. A kid playing a game of chess most certainly made a couple of good moves. Your task is to find these moves. Or maybe he remembered to press the clock most of the time after his move. Or he used the available time well to think carefully. Or he remembered to shake hands and setup the board again after the game.</p>
<p>Praise him for that.</p>
<p>It will move the focus to the things he did well. It will turn his focus in something positive. It will motivate him to continue playing and learning. And sooner or later he will start taking care of his queen as well.</p>
<p>And the same applies when you are coaching grown ups. A software developer who introduced a bug knows he made a mistake. And he doesn&#8217;t enjoys it. Especially when it was a very damaging bug. chastening him doesn&#8217;t help. Instead find the thing he does well. Does a different module of him work well? Did he fix the bug quickly? Does he help his coworkers? Is he especially knowledgeable about a certain area? Did he improve some skills in the past months? Praise him for that.</p>
<p>You might think &#8220;But I can&#8217;t praise the people that make mistakes! That&#8217;s unfair&#8221;. You are wrong. You can. You should. You MUST. But of course you should praise the ones doing good work as well. The difference is: Praising the good is much easier and requires much less skill on your side. So if you have problems with praising, you might start with the good ones today.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.schauderhaft.de/2010/06/20/possibly-the-most-important-skill-for-managers-coaches-teachers-and-parents/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.387 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-03 09:16:17 -->
<!-- Compression = gzip -->