<?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>Olaf&#039;s blog &#187; hibernate</title>
	<atom:link href="http://olafsblog.sysbsb.de/category/hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://olafsblog.sysbsb.de</link>
	<description>Olaf&#039;s blog on software development and life</description>
	<lastBuildDate>Thu, 18 Nov 2010 07:57:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facts on open source projects for decision-makers</title>
		<link>http://olafsblog.sysbsb.de/more-facts-on-open-source-projects-for-decision-makers/</link>
		<comments>http://olafsblog.sysbsb.de/more-facts-on-open-source-projects-for-decision-makers/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 14:16:41 +0000</pubDate>
		<dc:creator>olaf</dc:creator>
				<category><![CDATA[QA]]></category>
		<category><![CDATA[System architecture]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[ohloh.net]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://olafsblog.sysbsb.de/?p=64</guid>
		<description><![CDATA[Summary
Finding useful information about open source software projects can be tedious &#8211; especially when trying to find facts that your customers understand.
ohloh.net provides excellent, comparable meta information for open source projects and should be on every decision-makers favorites list.
Why this software and not another?
I often find the need to justify the use of a specific [...]]]></description>
			<content:encoded><![CDATA[<h3>Summary</h3>
<p>Finding useful information about open source software projects can be tedious &#8211; especially when trying to find facts that your customers understand.<br />
<a href="http://www.ohloh.net/projects/search">ohloh.net provides excellent, comparable meta information for open source projects</a> and should be on every decision-makers favorites list.</p>
<h3>Why this software and not another?</h3>
<p>I often find the need to justify the use of a specific open source software. Why is is better than another, competing open source software? How much better is the community support? How many supporters does it have? How active is the project and how much effort was spend on it&#8217;s development? How about metrics for the code, and how do you compare software in general?<br />
Those are about the most important questions i have to answer.<br />
<span id="more-64"></span></p>
<h3>Obtaining information about open source projects</h3>
<p>Most of the above questions are not so easy to answer. When it comes to usage statistics and community support, one might be lucky to find the number of committers and the number of downloads, the number of mailings on the project mailing list or a more or less qualified article in a software mag. All of this information can usually be googled up or located on the projects site.<br />
Unfortunately, many of the above facts are only loosely related to a project&#8217;s code quality.<br />
To compare code, i am usually downloading the software and run QA tools on it, such as <a href="http://findbugs.sourceforge.net/">findbugs</a> and <a href="http://www.kclee.de/clemens/java/javancss/">JAVANCSS</a>. But code metrics are something that developers understand, but customers usually do not. They want to know how many happy users a software has and whether or not community support might last long enough to justify investments.</p>
<h3>Best practice: ohloh.net</h3>
<div  style="float:right;margin:0 0 1em 1em;width:303px;height:270px;"><img id="image65" src="http://olafsblog.sysbsb.de/wp-content/uploads/2008/10/hibernate-investment-costs.jpg" alt="Ohloh.net: Investment costs for hibernate so far" /><br /><span style="font-size:80%;">ohloh.net: Money spend on developing hibernate, calculation based on the COCOMO model.</span></div>
<p>Looking for such Information, i found <a href="http://www.ohloh.net/projects/hibernate">ohloh.net&#8217;s project information site for hibernate</a>.<br />
To my surprise, it had most of the things i was looking for. Code metrics. Information on who is involved in the projects development. Usage statistics. Ratings. Reviews. Journal links. An executive summary and statements on the code quality and project state, based on facts.  </p>
<p>
To sum it up i wish that more projects would publish information to the same extend ohloh does. ohloh.net&#8217;s project meta-information should be an example and a blue print for other big open source sites. Sourceforge, for example, is already publishing some useful project information (see for example <a href="http://sourceforge.net/projects/findbugs/">findbugs sf project page</a>) but does not deliver the same amount and quality of information that ohloh has to offer.</p>
]]></content:encoded>
			<wfw:commentRss>http://olafsblog.sysbsb.de/more-facts-on-open-source-projects-for-decision-makers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClassCastException, PersistentCollection, Hibernate &amp; JPA</title>
		<link>http://olafsblog.sysbsb.de/jpa-hibernate-cannot-be-cast-to-orghibernatecollectionpersistentcollection/</link>
		<comments>http://olafsblog.sysbsb.de/jpa-hibernate-cannot-be-cast-to-orghibernatecollectionpersistentcollection/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 22:06:20 +0000</pubDate>
		<dc:creator>olaf</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[System architecture]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://olafsblog.sysbsb.de/?p=33</guid>
		<description><![CDATA[Verwendet man Hibernate (und JPA) kann es mitunter zu recht exotischen Fehlern kommen.
Ein Beispiel, zu dem ich bei google heute nicht einen einzigen Treffer gefunden habe ist folgende Exception:

...
Caused by: javax.persistence.RollbackException: Error while commiting the transaction
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
        at org.springframework.orm.jpa.JpaTransactionManager.doCommit(
  [...]]]></description>
			<content:encoded><![CDATA[<p>Verwendet man Hibernate (und JPA) kann es mitunter zu recht exotischen Fehlern kommen.<br />
Ein Beispiel, zu dem ich bei google heute <em>nicht einen einzigen Treffer gefunden</em> habe ist folgende Exception:</p>
<p><code><br />
...<br />
Caused by: javax.persistence.RollbackException: Error while commiting the transaction<br />
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)<br />
        at org.springframework.orm.jpa.JpaTransactionManager.doCommit(<br />
        JpaTransactionManager.java:438)<br />
        ... 55 more<br />
Caused by: <strong>java.lang.ClassCastException: java.util.HashSet<br />
        cannot be cast to org.hibernate.collection.PersistentCollection</strong><br />
        at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:34)<br />
...<br />
</code><br />
<span id="more-33"></span><br />
Das tritt dann auf, wenn man wohlmeinend die Exposition der internen Repräsentation vermeiden wollte und beispielsweise so etwas hier auf einer persistenten Collection macht:</p>
<pre class="brush: java;">
 @Entity
 public  class foo {
       private Set&lt;AnotherEntity&gt; _relatedEntites = new HashSet&lt;AnotherEntity&gt;();

     @OneToMany(cascade = {CascadeType.ALL }, fetch = FetchType.LAZY)
     @Column(name = &quot;RELATED_ENTITIES&quot;)
      public Set&lt;AnotherEntity&gt; getRelatedEntities() {
            return new HashSet&lt;AnotherEntity&gt;(_relatedEntites)
     }
 }
</pre>
<p>Das: <strong>new HashSet<AnotherEntity>(</strong>&#8230;<strong>)</strong> ist ein Fehler, da es aus der vorher erzeugten persistenten Collection wieder eine HashMap macht, die nicht persistiertbar ist.</p>
<p>Um die Manipulierbarkeit der Klasse zu vermeiden kann man stattdessen die <em>@Immutable</em>-Annotation verwenden:</p>
<pre class="brush: java;">
 @Entity
 public  class foo {
       private Set&lt;AnotherEntity&gt; _relatedEntites = new HashSet&lt;AnotherEntity&gt;();

     @OneToMany(cascade = {CascadeType.ALL }, fetch = FetchType.LAZY)
     @Column(name = &quot;RELATED_ENTITIES&quot;)
     @Immutable
      public Set&lt;AnotherEntity&gt; getRelatedEntities() {
            return _relatedEntites;
     }
 }
</pre>
<p>Dann klappt&#8217;s auch mit Hibernate.</p>
]]></content:encoded>
			<wfw:commentRss>http://olafsblog.sysbsb.de/jpa-hibernate-cannot-be-cast-to-orghibernatecollectionpersistentcollection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

