<?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>The Geek Blog &#187; java</title>
	<atom:link href="http://www.artin.org/geekblog/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artin.org/geekblog</link>
	<description>A place to write down the crap from my brain</description>
	<lastBuildDate>Mon, 16 Jan 2012 14:45:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Hibernate 3.6.0.Final + PostgreSQL + CLOBs</title>
		<link>http://www.artin.org/geekblog/2011/01/hibernate-3-6-0-final-postgresql-clobs/</link>
		<comments>http://www.artin.org/geekblog/2011/01/hibernate-3-6-0-final-postgresql-clobs/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 15:44:55 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.artin.org/geekblog/?p=92</guid>
		<description><![CDATA[I recently upgraded a project I&#8217;m working on to Hibernate 3.6.0.Final from 3.5.6 and realized that one of my entities that had a CLOB (character large object) was pooping out.  I was getting an exception stack track similar to: Caused by: org.postgresql.util.PSQLException: Bad value for type long : &#60;table border="0" cellspacing="0" cellpadding="0" id="productDetailLineItems"&#62;&#60;thead&#62;&#60;tr&#62;&#60;td rowspan="2"&#62;&#60;input type="hidden" [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded a project I&#8217;m working on to Hibernate 3.6.0.Final from 3.5.6 and realized that one of my entities that had a CLOB (character large object) was pooping out.  I was getting an exception stack track similar to:</p>
<pre>Caused by: org.postgresql.util.PSQLException: Bad value for type long : &lt;table border="0" cellspacing="0" cellpadding="0" id="productDetailLineItems"&gt;&lt;thead&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;&lt;input type="hidden" name="productGroupId" id="productGroupId" value="101111"/&gt;Item Number&lt;/td&gt;&lt;td rowspan="2"&gt;Motor HP&lt;/td&gt;&lt;td rowspan="2"&gt;Price&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;form method="post" id="4581000" name="4581000" action=""&gt;&lt;td&gt;4581000&lt;/td&gt;&lt;td&gt;&lt;span style="fraction"&gt;&lt;sup&gt;1&lt;/sup&gt;/&lt;sub&gt;2&lt;/sub&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" onclick="javascript:addToCart('4581000');" value="$prc4581000" /&gt;&lt;/td&gt;&lt;/form&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</pre>
<pre>at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2690) [:]</pre>
<pre>at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:1995) [:]</pre>
<pre>at org.postgresql.jdbc3.Jdbc3ResultSet.getClob(Jdbc3ResultSet.java:44) [:]</pre>
<pre>at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getClob(AbstractJdbc2ResultSet.java:373) [:]</pre>
<pre>at org.jboss.resource.adapter.jdbc.WrappedResultSet.getClob(WrappedResultSet.java:516) [:6.0.0.Final]</pre>
<pre>at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$2.doExtract(ClobTypeDescriptor.java:70) [:3.6.0.Final]</pre>
<pre>at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) [:3.6.0.Final]</pre>
<pre>at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253) [:3.6.0.Final]</pre>
<pre>at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249) [:3.6.0.Final]</pre>
<pre>at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229) [:3.6.0.Final]</pre>
<pre>at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330) [:3.6.0.Final]</pre>
<pre>at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.getRow(Loader.java:1355) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.doQuery(Loader.java:829) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) [:3.6.0.Final]</pre>
<pre>at org.hibernate.loader.Loader.loadEntity(Loader.java:2037) [:3.6.0.Final]</pre>
<pre>... 167 more</pre>
<p>I do local development on my MacBook Pro with PostgreSQL 9.0.2 and will point my machine at the client&#8217;s DB2 database once in a while for pushes to their development system.  When I point the system at their DB dev database, everything works fine.  Pointing back at my PostgreSQL, the entity craps out.  I tried going back to the old 8.0 driver like some people online suggested with no luck.  I hadn&#8217;t tried using this entity since I upgraded to Hibernate 3.6 because I also have been moving from OpenEJB to JBoss 6 so it could have been that as well.</p>
<p>Ultimately I found a simple solution.  PostgreSQL apparently doesn&#8217;t play well with Hibernate 3.6 and requires a specific Hibernate annotation on your entity (I&#8217;m using JPA entities by the way).  On your CLOB, in addition to the @Lob, add:</p>
<pre>@Type(type="org.hibernate.type.StringClobType")</pre>
<p>Redeploy your application and Hibernate should behave properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artin.org/geekblog/2011/01/hibernate-3-6-0-final-postgresql-clobs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flush THIS Hibernate!</title>
		<link>http://www.artin.org/geekblog/2010/06/flush-this-hibernate/</link>
		<comments>http://www.artin.org/geekblog/2010/06/flush-this-hibernate/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 12:25:41 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[hibernate search]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.artin.org/geekblog/?p=71</guid>
		<description><![CDATA[I&#8217;ve been working with Hibernate 3.3.2 and Hibernate Search 3.1 for the past few months.  We finally got to a point in our project where we are sucking in mass amounts of data into our application from a large business application via JMS.  Suddenly, I&#8217;m getting the following errors during persistence: org.hibernate.AssertionFailure: collection [ class [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with Hibernate 3.3.2 and Hibernate Search 3.1 for the past few months.  We finally got to a point in our project where we are sucking in mass amounts of data into our application from a large business application via JMS.  Suddenly, I&#8217;m getting the following errors during persistence:</p>
<p>org.hibernate.AssertionFailure: collection [ class name here ] was not processed by flush()</p>
<p>I tried changing the owning side of the collection, made a join table, and nothing helped.  The error started when I added an @IndexEmbedded annotation to the collection, and I discovered I was missing the @ContainedIn annotation in the collection entity.  That didn&#8217;t fix it.  After weeks of doing little tweaks, breaking, fixing, breaking, fixing, I finally discovered the problem.  I was using an older manual for Hibernate Search (3.0 specifically) and I had the following configuration parameter pushed into my SessionFactory:</p>
<p>hibernate.search.worker.batch_size = 1</p>
<p>As of Hibernate Search 3.1, that parameter has been deprecated.  It has been replaced by a number of other settings allowing finer-grained control over your batch processing in Hibernate Search.  Eventually we&#8217;re upgrading to Hibernate Search 3.2 which handles batches altogether differently/better.  Thought I&#8217;d share, because this one had me stumped.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artin.org/geekblog/2010/06/flush-this-hibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google App Engine &amp; Java</title>
		<link>http://www.artin.org/geekblog/2009/04/google-app-engine-java/</link>
		<comments>http://www.artin.org/geekblog/2009/04/google-app-engine-java/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 20:46:12 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[App Engine]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.artin.org/geekblog/?p=31</guid>
		<description><![CDATA[So I&#8217;ve spent a few days going over Google App Engine for Java.  So far, I have to say, I&#8217;m impressed.  Google has created a really cool service that lets anyone write a Java web application and host it on their multitude of servers.  This is all for free, I might add.  You have to [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve spent a few days going over Google App Engine for Java.  So far, I have to say, I&#8217;m impressed.  Google has created a really cool service that lets anyone write a Java web application and host it on their multitude of servers.  This is all for free, I might add.  You have to be aware of a number of limitations including no threading and you&#8217;re limited to their data store for persistence.  Once you get over that, you&#8217;ll see the advantage of it:</p>
<ol>
<li>Reliability</li>
<li>Durability</li>
<li>Security</li>
<li>Scalability</li>
</ol>
<p>So I got a little overwhelmed with the &#8220;ity&#8221; words, but it&#8217;s very appropriate.  App Engine for Java will take the &#8220;cloud&#8221; by storm, I think.  I have been looking for a Java web host and am always discouraged by the price and the limitation on memory and disk space.  With Google, you can get a decently sized application running for free and they provide all the nuts &amp; bolts.</p>
<p>Nice, Google.  Computing in the cloud isn&#8217;t such a farce as I thought it was.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artin.org/geekblog/2009/04/google-app-engine-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft WCF Web Services &amp; Java</title>
		<link>http://www.artin.org/geekblog/2009/03/microsoft-wcf-web-services-java/</link>
		<comments>http://www.artin.org/geekblog/2009/03/microsoft-wcf-web-services-java/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 20:43:16 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring framework]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://www.artin.org/geekblog/?p=29</guid>
		<description><![CDATA[I spent a good 50+ hours on trying to consume a Microsoft WCF secure web service with a Java solution.  I tried Spring Web Services, Axis2, and looked at Metro/Tango and decided Axis2 was the &#8220;easiest&#8221; solution.  The web service I&#8217;m connecting to implements WS-Security, WS-SecureConversation, WS-Policy, WS-Trust and WS-Addressing (at least) and it&#8217;s provided [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a good 50+ hours on trying to consume a Microsoft WCF secure web service with a Java solution.  I tried Spring Web Services, Axis2, and looked at Metro/Tango and decided Axis2 was the &#8220;easiest&#8221; solution.  The web service I&#8217;m connecting to implements WS-Security, WS-SecureConversation, WS-Policy, WS-Trust and WS-Addressing (at least) and it&#8217;s provided through a .NET 3.5 WCF endpoint.</p>
<p>It doesn&#8217;t work.</p>
<p>Axis2 can&#8217;t handle SpNego which is a WCF closed protocol allowing two WCF machines to negotiate the credentials between them.  The client has spent way too much money paying me to continue to figure out a Java solution, so I wrote a .NET 3.5 C# client.  Took me literally five lines of code and it&#8217;s working.  That&#8217;s great for .NET developers but a whole lotta horse shit for the rest of the world.  I&#8217;m hoping Axis2&#8242;s Rampart module is updated to play nice with WS-SecureConversation and a .NET WCF web service.  Until then, I&#8217;m using the .NET client to download the data and I&#8217;m storing the SOAP body into a database table.  On the Java side, I&#8217;m still using JAXB2 to unmarshall the data into Java objects and process it through our existing persistence framework.</p>
<p>Go me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artin.org/geekblog/2009/03/microsoft-wcf-web-services-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

