<?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>Vitor Rodrigues &#187; db2express-c</title>
	<atom:link href="http://www.vitorrodrigues.com/blog/tag/db2express-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vitorrodrigues.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 28 Sep 2009 18:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Persisting XML with OpenJPA</title>
		<link>http://www.vitorrodrigues.com/blog/2007/10/23/persisting-xml-in-openjpa/</link>
		<comments>http://www.vitorrodrigues.com/blog/2007/10/23/persisting-xml-in-openjpa/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 18:15:46 +0000</pubDate>
		<dc:creator>vitor</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2express-c]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[openjpa]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[purexml]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.vitorrodrigues.com/blog/2007/10/23/persisting-xml-in-openjpa/</guid>
		<description><![CDATA[I&#8217;ve been looking at JPA &#8211; Java Persistence Architecture and decided to play a bit with OpenJPA using DB2 as the back-end. My goal: to persist and query XML data in DB2, making use of DB2&#8242;s pureXML capabilities to query the XML data using SQL/XML&#8216;s XMLQUERY() function. However, while OpenJPA has an extensive documentation, the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking at <a href="http://java.sun.com/javaee/overview/faq/persistence.jsp">JPA &#8211; Java Persistence Architecture</a> and decided to play a bit with <a href="http://openjpa.apache.org">OpenJPA </a>using <a href="http://www.ibm.com/db2/express">DB2 </a>as the back-end. My goal: to persist and query XML data in DB2, making use of DB2&#8242;s <a href="http://www.ibm.com/software/data/db2/9/editions_features_purexml.html%20">pureXML </a>capabilities to query the XML data using <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=35341">SQL/XML</a>&#8216;s XMLQUERY() function.
</p>
<p>However, while OpenJPA has an <a href="http://openjpa.apache.org/docs/latest/manual/manual.html">extensive documentation</a>, the examples are not always complete and there isn&#8217;t a lot of information on the web regarding OpenJPA error determination and solving. So, here are some recommendations for some of the problems I have encountered. The class <em>xml.Addres</em>s is the one to be persisted as XML in the database using JPA and it is stored as the field <em>shipAddress </em>of the <em>Order </em>objects.<br />
  
</p>
<pre> [java] Exception in thread "main" &lt;openjpa-1.0.0-r420667:568756 fatal user error&gt;
org.apache.openjpa.persistence.ArgumentException:
Type "class xml.Address" does not have persistence metadata.&nbsp;
</pre>
<p><strong>Suggestion:</strong> Remove the reference to <em>xml.Address</em> from <em>persistence.xml</em>.&nbsp;
</p>
<pre>[java] Exception in thread "main" &lt;openjpa-1.0.0-r420667:568756 nonfatal user error&gt;
org.apache.openjpa.persistence.InvalidStateException:
Encountered unmanaged object "xml.Address@9b2a51" in
persistent field "xml.Order.shipAddress" of managed object "xml.Order@12b3349"
during flush.&nbsp; However, this field does not allow cascade persist.&nbsp;
You cannot flush unmanaged objects.
  [java] FailedObject: xml.Address@9b2a51
</pre>
<p><strong>Suggestion</strong><strong>:</strong> Make sure you have no <em>@Entity</em> or <em>@Embeddable</em> annotations in <em>xml.Address</em>. The main annotation is <em>@XmlRootElement</em>.
</p>
<pre> [java] Exception in thread "main" &lt;openjpa-1.0.0-r420667:568756 fatal general error&gt;
org.apache.openjpa.persistence.PersistenceException:
"xml" doesnt contain ObjectFactory.class or jaxb.index
</pre>
<p><strong>Suggestion</strong><strong>:</strong> add a file <em>jaxb.index</em> into your <em>xml </em>package containing all the classes to be persisted as XML: a file containing <em>Address</em> in our case.</p>
<img src="http://www.vitorrodrigues.com/blog/?ak_action=api_record_view&id=116&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vitorrodrigues.com/blog/2007/10/23/persisting-xml-in-openjpa/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>DB2 on Mac</title>
		<link>http://www.vitorrodrigues.com/blog/2007/09/24/db2-on-mac/</link>
		<comments>http://www.vitorrodrigues.com/blog/2007/09/24/db2-on-mac/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 19:59:37 +0000</pubDate>
		<dc:creator>vitor</dc:creator>
				<category><![CDATA[DB2 pureXML]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2express-c]]></category>
		<category><![CDATA[db2expressc]]></category>
		<category><![CDATA[db2oncampus]]></category>
		<category><![CDATA[db2_student_ambassador]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.vitorrodrigues.com/blog/2007/09/24/db2-on-mac/</guid>
		<description><![CDATA[Last week, after my presentation at University of Minho about the DB2 on Campus and DB2 Student Ambassador programs and the pureXML features in DB2, one student came to me and asked me if DB2 was available for Mac. My answer was a &#8216;no&#8217;, but things will change pretty soon.&#160; My &#8216;office neighbor&#8217; Antonio Cangiano [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, after my presentation at University of Minho about the <a href="http://www.vitorrodrigues.com/blog/2007/09/15/db2-student-ambassador/">DB2 on Campus and DB2 Student Ambassador</a> programs and the pureXML features in DB2, one student came to me and asked me if <a href="http://www-306.ibm.com/software/data/db2/">DB2</a> was available for Mac. My answer was a &#8216;no&#8217;, but things will change pretty soon.&nbsp;
</p>
<p>My &#8216;office neighbor&#8217; <a href="http://antoniocangiano.com/">Antonio Cangiano</a> just made public IBM&#8217;s intention of releasing a <a href="http://antoniocangiano.com/2007/09/19/db2-on-mac/">DB2 Express-C port to Intel Mac</a>. This is one more big step from DB2 Express-C towards the community, after very open licensing conditions, Ruby on Rails driver and adapter, soon-to-come Python and Django driver and adapter, <a href="http://www.ibm.com/developerworks/forums//dw_forum.jsp?forum=805&amp;cat=19&amp;ca=drs-fo">DB2 Express-C orum</a> and <a href="http://db2expressc.blogspot.com/">DB2 Express-C blog</a>, etc&#8230;.<br />
  <br />&nbsp;</p>
<img src="http://www.vitorrodrigues.com/blog/?ak_action=api_record_view&id=107&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vitorrodrigues.com/blog/2007/09/24/db2-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

