<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
	<id>tag:n2.nabble.com,2006:forum-208411</id>
	<title>Nabble - OpenJPA Users</title>
	<updated>2009-11-24T14:55:22Z</updated>
	<link rel="self" type="application/atom+xml" href="http://n2.nabble.com/OpenJPA-Users-f208411.xml" />
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/OpenJPA-Users-f208411.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:n2.nabble.com,2006:post-4061808</id>
	<title>Re: How to specify LRS in orm.xml?</title>
	<published>2009-11-24T14:55:22Z</published>
	<updated>2009-11-24T14:55:22Z</updated>
	<author>
		<name>Pinaki Poddar</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;Any OpenJPA specific annotations are, unfortunately, not supported in XML descriptor. Because, JPA spec does not define a XML schema with a simple &amp;lt;name,value&amp;gt; mechanism for vendor extensions. OpenJPA can merge source code annotations with orm.xml -- so, one has to leave OpenJPA-specific mapping annotations on source code itself.
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Christopher Giblin wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hi
&lt;br&gt;The OpenJPA describes how to indicate that a field should use OpenJPA's
&lt;br&gt;large result set proxies using the @LRS Java annotation.
&lt;br&gt;&lt;br&gt;Can I specify LRS using orm.xml instead?
&lt;br&gt;&lt;br&gt;Thanks,chris
&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;div class=&quot;signature&quot;&gt;Pinaki &lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-to-specify-LRS-in-orm-xml-tp4061742p4061808.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4061742"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4061742</id>
	<title>How to specify LRS in orm.xml?</title>
	<published>2009-11-24T14:39:07Z</published>
	<updated>2009-11-24T14:39:07Z</updated>
	<author>
		<name>Christopher Giblin</name>
	</author>
	<content type="html">&lt;br&gt;Hi
&lt;br&gt;The OpenJPA describes how to indicate that a field should use OpenJPA's
&lt;br&gt;large result set proxies using the @LRS Java annotation.
&lt;br&gt;&lt;br&gt;Can I specify LRS using orm.xml instead?
&lt;br&gt;&lt;br&gt;Thanks,chris
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-to-specify-LRS-in-orm-xml-tp4061742p4061742.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4061136</id>
	<title>Re: Behavioral Inheritance</title>
	<published>2009-11-24T12:57:38Z</published>
	<updated>2009-11-24T12:57:38Z</updated>
	<author>
		<name>Judes Tumuhairwe</name>
	</author>
	<content type="html">Yes.
&lt;br&gt;In my app, I'm doing exactly this. I have a super class that all entities
&lt;br&gt;extend.
&lt;br&gt;&lt;br&gt;@MappedSuperclass
&lt;br&gt;public abstract class AuditableRecord{} that looks almost exactly like the
&lt;br&gt;ModelBase class here [1]
&lt;br&gt;&lt;br&gt;Basically it has a createDate [timestamp, updateable=false], createUser
&lt;br&gt;[string, updateable=false], and lastUpateDate and lastUpdateUser.
&lt;br&gt;&lt;br&gt;[1] See this for a complete example:
&lt;br&gt;&lt;a href=&quot;http://www.theserverside.com/tt/articles/article.tss?l=JPAObjectModel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.theserverside.com/tt/articles/article.tss?l=JPAObjectModel&lt;/a&gt;&lt;br&gt;&lt;br&gt;regards,
&lt;br&gt;Judes Tumuhairwe
&lt;br&gt;&lt;br&gt;On Tue, Nov 24, 2009 at 11:35 AM, Temujin_12 &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4061136&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm trying to figure out how to use inheritance with OpenJPA, however the
&lt;br&gt;&amp;gt; documentation I've read on inheritance describes it being used in a way
&lt;br&gt;&amp;gt; that
&lt;br&gt;&amp;gt; is different from how I'm trying to use it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In my database several tables have &amp;quot;audit_*&amp;quot; columns to track
&lt;br&gt;&amp;gt; creation/modification/author values for rows. What I'd like to do is create
&lt;br&gt;&amp;gt; an Auditable interface along with an OpenJPA-annotated abstract class that
&lt;br&gt;&amp;gt; maps these &amp;quot;audit_*&amp;quot; columns and provides the getters/setters along with
&lt;br&gt;&amp;gt; other audit-specific methods so that other OpenJPA classes that map to
&lt;br&gt;&amp;gt; different tables can just extend this abstract class and not have to
&lt;br&gt;&amp;gt; redefine the OpenJPA annotations.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Can this be done?
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/Behavioral-Inheritance-tp4058975p4058975.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Behavioral-Inheritance-tp4058975p4058975.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the OpenJPA Users mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Behavioral-Inheritance-tp4058975p4061136.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4058975"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4058975</id>
	<title>Behavioral Inheritance</title>
	<published>2009-11-24T08:35:34Z</published>
	<updated>2009-11-24T08:35:34Z</updated>
	<author>
		<name>Temujin_12</name>
	</author>
	<content type="html">I'm trying to figure out how to use inheritance with OpenJPA, however the documentation I've read on inheritance describes it being used in a way that is different from how I'm trying to use it.
&lt;br&gt;&lt;br&gt;In my database several tables have &amp;quot;audit_*&amp;quot; columns to track creation/modification/author values for rows. What I'd like to do is create an Auditable interface along with an OpenJPA-annotated abstract class that maps these &amp;quot;audit_*&amp;quot; columns and provides the getters/setters along with other audit-specific methods so that other OpenJPA classes that map to different tables can just extend this abstract class and not have to redefine the OpenJPA annotations.
&lt;br&gt;&lt;br&gt;Can this be done?</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Behavioral-Inheritance-tp4058975p4058975.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4056230</id>
	<title>Re: Schema wont create</title>
	<published>2009-11-23T23:14:00Z</published>
	<updated>2009-11-23T23:14:00Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">Ok, &amp;nbsp;So it seems that I was using the wrong tool. &amp;nbsp;Sorry for the post.
&lt;br&gt;&lt;br&gt;I was using SchemaTool instead of MappingTool.
&lt;br&gt;&lt;br&gt;Thomas
&lt;br&gt;On Nov 24, 2009, at 1:11 AM, Thomas Polliard wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Interesting, all the tales are null :(
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; [schematool] 340 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - Initial connection autoCommit: true, holdability: 1, TransactionIsolation: 2
&lt;br&gt;&amp;gt; [schematool] 448 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1573788650&amp;gt; [106 ms] close
&lt;br&gt;&amp;gt; [schematool] 453 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Schema tool running action &amp;quot;createDB&amp;quot;. &amp;nbsp;This process may take some time. &amp;nbsp;Enable the org.apache.openjpa.jdbc.Schema logging category to see messages about the collection of schema data, and the org.apache.openjpa.jdbc.SQL category to see generated SQL commands.
&lt;br&gt;&amp;gt; [schematool] 470 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading table information for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;&amp;gt; [schematool] 470 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; getColumns: null, null, null, null
&lt;br&gt;&amp;gt; [schematool] 509 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; getTables: null, null, null
&lt;br&gt;&amp;gt; [schematool] 516 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading sequence information for schema &amp;quot;null&amp;quot;, sequence name &amp;quot;null&amp;quot;.
&lt;br&gt;&amp;gt; [schematool] 520 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.SQL - &amp;lt;t 1486975107, conn 1141024511&amp;gt; executing prepstmnt 1623810826 SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES
&lt;br&gt;&amp;gt; [schematool] 521 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.SQL - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [0 ms] spent
&lt;br&gt;&amp;gt; [schematool] 523 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [0 ms] commit
&lt;br&gt;&amp;gt; [schematool] 627 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [104 ms] close
&lt;br&gt;&amp;gt; [schematool] 636 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading primary keys for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;&amp;gt; [schematool] 636 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; getPrimaryKeys: null, null, null
&lt;br&gt;&amp;gt; [schematool] 639 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; [0 ms] commit
&lt;br&gt;&amp;gt; [schematool] 742 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; [103 ms] close
&lt;br&gt;&amp;gt; [schematool] 750 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading indexes for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;&amp;gt; [schematool] 750 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; getIndexInfo: null, null, null
&lt;br&gt;&amp;gt; [schematool] 751 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; [0 ms] commit
&lt;br&gt;&amp;gt; [schematool] 854 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; [103 ms] close
&lt;br&gt;&amp;gt; [schematool] 860 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading foreign keys for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;&amp;gt; [schematool] 860 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1563063257&amp;gt; [0 ms] commit
&lt;br&gt;&amp;gt; [schematool] 964 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1563063257&amp;gt; [102 ms] close
&lt;br&gt;&amp;gt; [schematool] 964 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Recording schema changes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Any ideas why?
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4056230.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4056057"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4056057</id>
	<title>Re: Schema wont create</title>
	<published>2009-11-23T22:11:34Z</published>
	<updated>2009-11-23T22:11:34Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">Interesting, all the tales are null :(
&lt;br&gt;&lt;br&gt;&lt;br&gt;[schematool] 340 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - Initial connection autoCommit: true, holdability: 1, TransactionIsolation: 2
&lt;br&gt;[schematool] 448 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1573788650&amp;gt; [106 ms] close
&lt;br&gt;[schematool] 453 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Schema tool running action &amp;quot;createDB&amp;quot;. &amp;nbsp;This process may take some time. &amp;nbsp;Enable the org.apache.openjpa.jdbc.Schema logging category to see messages about the collection of schema data, and the org.apache.openjpa.jdbc.SQL category to see generated SQL commands.
&lt;br&gt;[schematool] 470 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading table information for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;[schematool] 470 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; getColumns: null, null, null, null
&lt;br&gt;[schematool] 509 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; getTables: null, null, null
&lt;br&gt;[schematool] 516 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading sequence information for schema &amp;quot;null&amp;quot;, sequence name &amp;quot;null&amp;quot;.
&lt;br&gt;[schematool] 520 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.SQL - &amp;lt;t 1486975107, conn 1141024511&amp;gt; executing prepstmnt 1623810826 SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES
&lt;br&gt;[schematool] 521 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.SQL - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [0 ms] spent
&lt;br&gt;[schematool] 523 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [0 ms] commit
&lt;br&gt;[schematool] 627 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1141024511&amp;gt; [104 ms] close
&lt;br&gt;[schematool] 636 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading primary keys for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;[schematool] 636 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; getPrimaryKeys: null, null, null
&lt;br&gt;[schematool] 639 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; [0 ms] commit
&lt;br&gt;[schematool] 742 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 245022965&amp;gt; [103 ms] close
&lt;br&gt;[schematool] 750 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading indexes for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;[schematool] 750 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; getIndexInfo: null, null, null
&lt;br&gt;[schematool] 751 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; [0 ms] commit
&lt;br&gt;[schematool] 854 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 103285717&amp;gt; [103 ms] close
&lt;br&gt;[schematool] 860 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.Schema - Reading foreign keys for schema name &amp;quot;null&amp;quot;, table name &amp;quot;null&amp;quot;.
&lt;br&gt;[schematool] 860 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1563063257&amp;gt; [0 ms] commit
&lt;br&gt;[schematool] 964 &amp;nbsp;icloud &amp;nbsp;TRACE &amp;nbsp;[main] openjpa.jdbc.JDBC - &amp;lt;t 1486975107, conn 1563063257&amp;gt; [102 ms] close
&lt;br&gt;[schematool] 964 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Recording schema changes.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Any ideas why?
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4056057.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055979"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055979</id>
	<title>Re: Schema wont create</title>
	<published>2009-11-23T21:42:35Z</published>
	<updated>2009-11-23T21:42:35Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">Im using a different database and Im using process based database. &amp;nbsp;Other then that I don't see a difference.&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 24, 2009, at 12:40 AM, crispyoz [via OpenJPA] wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;

Your properties look different to mine:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionDriverName&quot;
&lt;br&gt;value=&quot;com.mysql.jdbc.Driver&quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionURL&quot;
&lt;br&gt;value=&quot;jdbc:mysql://localhost:3306/trm&quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionUserName&quot;
&lt;br&gt;value=&quot;root&quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionPassword&quot;
&lt;br&gt;value=&quot;password&quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.jdbc.SynchronizeMappings&quot;
&lt;br&gt;value=&quot;buildSchema(ForeignKeys=true)&quot; /&amp;gt; 
&lt;br&gt;&amp;nbsp; 			&amp;lt;property name=&quot;openjpa.Log&quot;
&lt;br&gt;value=&quot;DefaultLevel=ERROR, Tool=ERROR&quot; /&amp;gt;
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: Thomas Polliard [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;amp;node=4055973&amp;amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Tuesday, 24 November 2009 3:54 PM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;amp;node=4055973&amp;amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: RE: Schema wont create
&lt;br&gt;&lt;br&gt;&lt;br&gt;Here is my persistence.xml. &amp;nbsp;Yes the classes are specified.
&lt;br&gt;&lt;br&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&lt;br&gt;&amp;lt;persistence version=&quot;1.0&quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns=&quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;xmlns:xsi=&quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;xsi:schemaLocation=&quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&lt;/a&gt;&quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;persistence-unit name=&quot;icloud&quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;lt;provider&amp;gt;org.apache.openjpa.persistence.PersistenceProviderImpl&amp;lt;/provider&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Article&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Author&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Tag&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionUserName&quot;
&lt;br&gt;value=&quot;SA&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionPassword&quot;
&lt;br&gt;value=&quot;&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionURL&quot;
&lt;br&gt;value=&quot;jdbc:hsqldb:file:/Users/polliard/Workspace/iCloud/build/db/personal;s
&lt;br&gt;hutdown=true&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionDriverName&quot;
&lt;br&gt;value=&quot;org.hsqldb.jdbcDriver&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.ConnectionFactoryProperties&quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=&quot;PrettyPrint=true,
&lt;br&gt;PrettyPrintLineLength=80&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&quot;openjpa.jdbc.SynchronizeMappings&quot;
&lt;br&gt;value=&quot;buildSchema(ForeignKeys=true)&quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/persistence-unit&amp;gt;
&lt;br&gt;&amp;lt;/persistence&amp;gt;
&lt;br&gt;-- 
&lt;br&gt;View this message in context:
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/Schema-wont-create-tp4055690p4055866.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Schema-wont-create-tp4055690p4055866.html&lt;/a&gt;&lt;br&gt;Sent from the OpenJPA Users mailing list archive at &lt;a href=&quot;http://Nabble.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Nabble.com&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;

&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055979.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055973"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055973</id>
	<title>RE: Schema wont create</title>
	<published>2009-11-23T21:31:24Z</published>
	<updated>2009-11-23T21:31:24Z</updated>
	<author>
		<name>crispyoz</name>
	</author>
	<content type="html">Your properties look different to mine:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionDriverName&amp;quot;
&lt;br&gt;value=&amp;quot;com.mysql.jdbc.Driver&amp;quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionURL&amp;quot;
&lt;br&gt;value=&amp;quot;jdbc:mysql://localhost:3306/trm&amp;quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionUserName&amp;quot;
&lt;br&gt;value=&amp;quot;root&amp;quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionPassword&amp;quot;
&lt;br&gt;value=&amp;quot;password&amp;quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.jdbc.SynchronizeMappings&amp;quot;
&lt;br&gt;value=&amp;quot;buildSchema(ForeignKeys=true)&amp;quot; /&amp;gt; 
&lt;br&gt;&amp;nbsp; 			&amp;lt;property name=&amp;quot;openjpa.Log&amp;quot;
&lt;br&gt;value=&amp;quot;DefaultLevel=ERROR, Tool=ERROR&amp;quot; /&amp;gt;
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: Thomas Polliard [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4055973&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Tuesday, 24 November 2009 3:54 PM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4055973&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: RE: Schema wont create
&lt;br&gt;&lt;br&gt;&lt;br&gt;Here is my persistence.xml. &amp;nbsp;Yes the classes are specified.
&lt;br&gt;&lt;br&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&lt;br&gt;&amp;lt;persistence version=&amp;quot;1.0&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns=&amp;quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;xmlns:xsi=&amp;quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;xsi:schemaLocation=&amp;quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&lt;/a&gt;&amp;quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;persistence-unit name=&amp;quot;icloud&amp;quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;lt;provider&amp;gt;org.apache.openjpa.persistence.PersistenceProviderImpl&amp;lt;/provider&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Article&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Author&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Tag&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionUserName&amp;quot;
&lt;br&gt;value=&amp;quot;SA&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionPassword&amp;quot;
&lt;br&gt;value=&amp;quot;&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionURL&amp;quot;
&lt;br&gt;value=&amp;quot;jdbc:hsqldb:file:/Users/polliard/Workspace/iCloud/build/db/personal;s
&lt;br&gt;hutdown=true&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionDriverName&amp;quot;
&lt;br&gt;value=&amp;quot;org.hsqldb.jdbcDriver&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionFactoryProperties&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=&amp;quot;PrettyPrint=true,
&lt;br&gt;PrettyPrintLineLength=80&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.jdbc.SynchronizeMappings&amp;quot;
&lt;br&gt;value=&amp;quot;buildSchema(ForeignKeys=true)&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/persistence-unit&amp;gt;
&lt;br&gt;&amp;lt;/persistence&amp;gt;
&lt;br&gt;-- 
&lt;br&gt;View this message in context:
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/Schema-wont-create-tp4055690p4055866.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Schema-wont-create-tp4055690p4055866.html&lt;/a&gt;&lt;br&gt;Sent from the OpenJPA Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055973.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055866"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055866</id>
	<title>RE: Schema wont create</title>
	<published>2009-11-23T20:53:40Z</published>
	<updated>2009-11-23T20:53:40Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">Here is my persistence.xml. &amp;nbsp;Yes the classes are specified.
&lt;br&gt;&lt;br&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&lt;br&gt;&amp;lt;persistence version=&amp;quot;1.0&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns=&amp;quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:xsi=&amp;quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xsi:schemaLocation=&amp;quot;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&lt;/a&gt;&amp;quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;persistence-unit name=&amp;quot;icloud&amp;quot;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;provider&amp;gt;org.apache.openjpa.persistence.PersistenceProviderImpl&amp;lt;/provider&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Article&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Author&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;com.trukoda.icloud.Tag&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionUserName&amp;quot; value=&amp;quot;SA&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionPassword&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionURL&amp;quot; value=&amp;quot;jdbc:hsqldb:file:/Users/polliard/Workspace/iCloud/build/db/personal;shutdown=true&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionDriverName&amp;quot; value=&amp;quot;org.hsqldb.jdbcDriver&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.ConnectionFactoryProperties&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value=&amp;quot;PrettyPrint=true, PrettyPrintLineLength=80&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name=&amp;quot;openjpa.jdbc.SynchronizeMappings&amp;quot; value=&amp;quot;buildSchema(ForeignKeys=true)&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/properties&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/persistence-unit&amp;gt;
&lt;br&gt;&amp;lt;/persistence&amp;gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055866.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055860"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055860</id>
	<title>RE: Schema wont create</title>
	<published>2009-11-23T20:49:26Z</published>
	<updated>2009-11-23T20:49:26Z</updated>
	<author>
		<name>crispyoz</name>
	</author>
	<content type="html">Did you add the type to your persistence.xml?
&lt;br&gt;&lt;br&gt;Also you need to set the property:
&lt;br&gt;&lt;br&gt;&amp;lt;property name=&amp;quot;openjpa.jdbc.SynchronizeMappings&amp;quot;
&lt;br&gt;value=&amp;quot;buildSchema(ForeignKeys=true)&amp;quot; /&amp;gt;
&lt;br&gt;&lt;br&gt;Hth
&lt;br&gt;&lt;br&gt;Chris
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: Thomas Polliard [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4055860&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Tuesday, 24 November 2009 3:42 PM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4055860&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: Re: Schema wont create
&lt;br&gt;&lt;br&gt;&lt;br&gt;The files do have persisted fields:
&lt;br&gt;&lt;br&gt;@Entity
&lt;br&gt;public class Article {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Id
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @GeneratedValue(strategy=GenerationType.AUTO)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int id = -1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ManyToOne(cascade=CascadeType.ALL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Author author = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Basic
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String title = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Basic
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String content = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ManyToMany(cascade=CascadeType.ALL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private List&amp;lt;Tag&amp;gt; tags = new ArrayList&amp;lt;Tag&amp;gt;();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .....
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;View this message in context:
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/Schema-wont-create-tp4055690p4055835.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Schema-wont-create-tp4055690p4055835.html&lt;/a&gt;&lt;br&gt;Sent from the OpenJPA Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055860.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055835"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055835</id>
	<title>Re: Schema wont create</title>
	<published>2009-11-23T20:41:50Z</published>
	<updated>2009-11-23T20:41:50Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">The files do have persisted fields:
&lt;br&gt;&lt;br&gt;@Entity
&lt;br&gt;public class Article {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Id
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @GeneratedValue(strategy=GenerationType.AUTO)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int id = -1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ManyToOne(cascade=CascadeType.ALL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Author author = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Basic
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String title = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Basic
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String content = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ManyToMany(cascade=CascadeType.ALL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private List&amp;lt;Tag&amp;gt; tags = new ArrayList&amp;lt;Tag&amp;gt;();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .....
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055835.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4055690"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4055690</id>
	<title>Schema wont create</title>
	<published>2009-11-23T19:50:20Z</published>
	<updated>2009-11-23T19:50:20Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">polliard@helium: ant 
&lt;br&gt;Buildfile: build.xml
&lt;br&gt;&lt;br&gt;init:
&lt;br&gt;&amp;nbsp; &amp;nbsp; [mkdir] Created dir: /Users/polliard/Workspace/iCloud/build
&lt;br&gt;&amp;nbsp; &amp;nbsp; [mkdir] Created dir: /Users/polliard/Workspace/iCloud/build/schema
&lt;br&gt;&amp;nbsp; &amp;nbsp; [mkdir] Created dir: /Users/polliard/Workspace/iCloud/build/META-INF
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[copy] Copying 1 file to /Users/polliard/Workspace/iCloud/build/META-INF
&lt;br&gt;&lt;br&gt;compile:
&lt;br&gt;&amp;nbsp; &amp;nbsp; [javac] Compiling 3 source files to /Users/polliard/Workspace/iCloud/build
&lt;br&gt;&lt;br&gt;BUILD SUCCESSFUL
&lt;br&gt;Total time: 0 seconds
&lt;br&gt;&lt;br&gt;=====
&lt;br&gt;polliard@helium: ant enhance
&lt;br&gt;Buildfile: build.xml
&lt;br&gt;&lt;br&gt;init:
&lt;br&gt;&lt;br&gt;compile:
&lt;br&gt;&lt;br&gt;enhance:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[echo] Enhancer Start
&lt;br&gt;&amp;nbsp;[enhancer] 242 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - No targets were given. &amp;nbsp;Running on all classes in your persistent classes list, or all metadata files in classpath directories if you have not listed your persistent classes. &amp;nbsp;Use -help to display tool usage information.
&lt;br&gt;&amp;nbsp;[enhancer] 361 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Enhance - Enhancing type &amp;quot;class com.trukoda.icloud.Author&amp;quot;.
&lt;br&gt;&amp;nbsp;[enhancer] 409 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Enhance - Enhancing type &amp;quot;class com.trukoda.icloud.Tag&amp;quot;.
&lt;br&gt;&amp;nbsp;[enhancer] 437 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Enhance - Enhancing type &amp;quot;class com.trukoda.icloud.Article&amp;quot;.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[echo] Enhancer Completed
&lt;br&gt;&lt;br&gt;BUILD SUCCESSFUL
&lt;br&gt;Total time: 0 seconds
&lt;br&gt;&lt;br&gt;========
&lt;br&gt;polliard@helium: export CLASSPATH=.:/Users/polliard/Library/Java/openjpa/2.0-M3/openjpa-all-2.0.0-M3.jar:/Users/polliard/Library/Java/hsqldb/1.8.1.1/hsqldb-1.8.1.1.jar 
&lt;br&gt;[~/Workspace/iCloud/build]
&lt;br&gt;polliard@helium: java org.apache.openjpa.jdbc.schema.SchemaTool -a createDB -f stdout
&lt;br&gt;55 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.jdbc.JDBC - Using dictionary class &amp;quot;org.apache.openjpa.jdbc.sql.HSQLDictionary&amp;quot;.
&lt;br&gt;402 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Schema tool running action &amp;quot;createDB&amp;quot;. &amp;nbsp;This process may take some time. &amp;nbsp;Enable the org.apache.openjpa.jdbc.Schema logging category to see messages about the collection of schema data, and the org.apache.openjpa.jdbc.SQL category to see generated SQL commands.
&lt;br&gt;909 &amp;nbsp;icloud &amp;nbsp;INFO &amp;nbsp; [main] openjpa.Tool - Recording schema changes.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Yet no output and the database has no tables. &amp;nbsp;Any ideas?
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Schema-wont-create-tp4055690p4055690.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4062175</id>
	<title>Re: Question regarding -properties option of ReverseMappingTool</title>
	<published>2009-11-24T16:23:45Z</published>
	<updated>2009-11-24T16:23:45Z</updated>
	<author>
		<name>ljnelson</name>
	</author>
	<content type="html">Hello; I&amp;#39;m running without a SecurityManager.  I have no policies of any kind set one way or another.&lt;br&gt;&lt;br&gt;Best,&lt;br&gt;Laird&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Nov 24, 2009 at 6:07 PM, Pinaki Poddar [via OpenJPA] &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4062175&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

Hi,
&lt;br&gt;  do you have the following security policies set?
&lt;br&gt;&lt;br&gt;permission java.lang.RuntimePermission &amp;quot;getClassLoader&amp;quot;;
&lt;br&gt;permission java.io.FilePermission &amp;quot;read&amp;quot;;
&lt;br&gt;&lt;div class=&quot;im&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;ljnelson wrote:&lt;/div&gt;
&lt;div&gt;The documentation for ReverseMappingTool says that the -properties command
&lt;br&gt;line option can take a file path or a resource name.
&lt;br&gt;&lt;br&gt;I can get this to work if I give a file path, but not if I give a resource
&lt;br&gt;name.
&lt;br&gt;&lt;br&gt;Assume I&amp;#39;m in the C:\crap directory.  If I specify this:
&lt;br&gt;&lt;br&gt;-properties C:\crap\META-INF\openjpa.xml
&lt;br&gt;&lt;br&gt;...everything works.
&lt;br&gt;&lt;br&gt;If I specify either of these with a classpath that includes the current
&lt;br&gt;directory:
&lt;br&gt;&lt;br&gt;-properties META-INF/openjpa.xml
&lt;br&gt;-properties /META-INF/openjpa.xml
&lt;br&gt;-properties openjpa.xml
&lt;br&gt;&lt;br&gt;...the openjpa.xml file is not picked up.
&lt;br&gt;&lt;br&gt;Is the documentation in error, or do I not fully understand what a resource
&lt;br&gt;name is?
&lt;br&gt;&lt;br&gt;OpenJPA 1.2.1.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Laird
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;/div&gt;&lt;div&gt;Pinaki &lt;/div&gt;

&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Question-regarding-properties-option-of-ReverseMappingTool-tp4052794p4062175.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4061854"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4061854</id>
	<title>Re: Question regarding -properties option of ReverseMappingTool</title>
	<published>2009-11-24T15:07:36Z</published>
	<updated>2009-11-24T15:07:36Z</updated>
	<author>
		<name>Pinaki Poddar</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&amp;nbsp; do you have the following security policies set?
&lt;br&gt;&lt;br&gt;permission java.lang.RuntimePermission &amp;quot;getClassLoader&amp;quot;;
&lt;br&gt;permission java.io.FilePermission &amp;quot;read&amp;quot;;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;ljnelson wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;The documentation for ReverseMappingTool says that the -properties command
&lt;br&gt;line option can take a file path or a resource name.
&lt;br&gt;&lt;br&gt;I can get this to work if I give a file path, but not if I give a resource
&lt;br&gt;name.
&lt;br&gt;&lt;br&gt;Assume I'm in the C:\crap directory. &amp;nbsp;If I specify this:
&lt;br&gt;&lt;br&gt;-properties C:\crap\META-INF\openjpa.xml
&lt;br&gt;&lt;br&gt;...everything works.
&lt;br&gt;&lt;br&gt;If I specify either of these with a classpath that includes the current
&lt;br&gt;directory:
&lt;br&gt;&lt;br&gt;-properties META-INF/openjpa.xml
&lt;br&gt;-properties /META-INF/openjpa.xml
&lt;br&gt;-properties openjpa.xml
&lt;br&gt;&lt;br&gt;...the openjpa.xml file is not picked up.
&lt;br&gt;&lt;br&gt;Is the documentation in error, or do I not fully understand what a resource
&lt;br&gt;name is?
&lt;br&gt;&lt;br&gt;OpenJPA 1.2.1.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Laird
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;div class=&quot;signature&quot;&gt;Pinaki &lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Question-regarding-properties-option-of-ReverseMappingTool-tp4052794p4061854.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4052794"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4052794</id>
	<title>Question regarding -properties option of ReverseMappingTool</title>
	<published>2009-11-23T09:54:43Z</published>
	<updated>2009-11-23T09:54:43Z</updated>
	<author>
		<name>ljnelson</name>
	</author>
	<content type="html">The documentation for ReverseMappingTool says that the -properties command
&lt;br&gt;line option can take a file path or a resource name.
&lt;br&gt;&lt;br&gt;I can get this to work if I give a file path, but not if I give a resource
&lt;br&gt;name.
&lt;br&gt;&lt;br&gt;Assume I'm in the C:\crap directory. &amp;nbsp;If I specify this:
&lt;br&gt;&lt;br&gt;-properties C:\crap\META-INF\openjpa.xml
&lt;br&gt;&lt;br&gt;...everything works.
&lt;br&gt;&lt;br&gt;If I specify either of these with a classpath that includes the current
&lt;br&gt;directory:
&lt;br&gt;&lt;br&gt;-properties META-INF/openjpa.xml
&lt;br&gt;-properties /META-INF/openjpa.xml
&lt;br&gt;-properties openjpa.xml
&lt;br&gt;&lt;br&gt;...the openjpa.xml file is not picked up.
&lt;br&gt;&lt;br&gt;Is the documentation in error, or do I not fully understand what a resource
&lt;br&gt;name is?
&lt;br&gt;&lt;br&gt;OpenJPA 1.2.1.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Laird
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Question-regarding-properties-option-of-ReverseMappingTool-tp4052794p4052794.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4050689</id>
	<title>RE: How to count on a query then reuse this query fetch data?</title>
	<published>2009-11-23T04:06:34Z</published>
	<updated>2009-11-23T04:06:34Z</updated>
	<author>
		<name>Michael Vorburger-4</name>
	</author>
	<content type="html">Hi 周雁鸣,
&lt;br&gt;&lt;br&gt;CriteriaQuery&amp;lt;User&amp;gt; cq = ...
&lt;br&gt;TypedQuery&amp;lt;User&amp;gt; tq = em.createQuery(cq);
&lt;br&gt;&lt;br&gt;tq.setFirstResult(0);
&lt;br&gt;tq.setMaxResults(10);
&lt;br&gt;List&amp;lt;User&amp;gt; users = tq.getResultList();
&lt;br&gt;&lt;br&gt;long count = users.size();
&lt;br&gt;&lt;br&gt;This will, normally, generate TWO SQL queries - a SELECT {columns} ... and a SELECT COUNT(id).
&lt;br&gt;&lt;br&gt;Ok?
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: 周雁鸣 [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4050689&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Monday, November 23, 2009 3:12 AM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4050689&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: How to count on a query then reuse this query fetch data?
&lt;br&gt;&lt;br&gt;CriteriaQuery&amp;lt;User&amp;gt; cq = ...
&lt;br&gt;TypedQuery&amp;lt;User&amp;gt; tq = em.createQuery(cq);
&lt;br&gt;&lt;br&gt;long count = count(tq); //howto?
&lt;br&gt;&lt;br&gt;tq.setFirstResult(0);
&lt;br&gt;tq.setMaxResults(10);
&lt;br&gt;List&amp;lt;User&amp;gt; users = tq.getResultList();
&lt;br&gt;&lt;br&gt;how to implement count function and I can reuse query object to find entities.
&lt;br&gt;&lt;br&gt;____________________________________________________________
&lt;br&gt;&lt;br&gt;� This email and any files transmitted with it are CONFIDENTIAL and intended
&lt;br&gt;&amp;nbsp; solely for the use of the individual or entity to which they are addressed.
&lt;br&gt;� Any unauthorized copying, disclosure, or distribution of the material within
&lt;br&gt;&amp;nbsp; this email is strictly forbidden.
&lt;br&gt;� Any views or opinions presented within this e-mail are solely those of the
&lt;br&gt;&amp;nbsp; author and do not necessarily represent those of Odyssey Financial
&lt;br&gt;Technologies SA unless otherwise specifically stated.
&lt;br&gt;� An electronic message is not binding on its sender. Any message referring to
&lt;br&gt;&amp;nbsp; a binding engagement must be confirmed in writing and duly signed.
&lt;br&gt;� If you have received this email in error, please notify the sender immediately
&lt;br&gt;&amp;nbsp; and delete the original.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-to-count-on-a-query-then-reuse-this-query-fetch-data-tp4048648p4050689.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4048648"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4048648</id>
	<title>How to count on a query then reuse this query fetch data?</title>
	<published>2009-11-22T18:12:19Z</published>
	<updated>2009-11-22T18:12:19Z</updated>
	<author>
		<name>周雁鸣</name>
	</author>
	<content type="html">CriteriaQuery&amp;lt;User&amp;gt; cq = ...
&lt;br&gt;TypedQuery&amp;lt;User&amp;gt; tq = em.createQuery(cq);
&lt;br&gt;&lt;br&gt;long count = count(tq); //howto?
&lt;br&gt;&lt;br&gt;tq.setFirstResult(0);
&lt;br&gt;tq.setMaxResults(10);
&lt;br&gt;List&amp;lt;User&amp;gt; users = tq.getResultList();
&lt;br&gt;&lt;br&gt;how to implement count function and I can reuse query object to find
&lt;br&gt;entities.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-to-count-on-a-query-then-reuse-this-query-fetch-data-tp4048648p4048648.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4043477</id>
	<title>Re: OpenJPA 1.2.1 violates JPA 1.0 specification</title>
	<published>2009-11-21T10:14:14Z</published>
	<updated>2009-11-21T10:14:14Z</updated>
	<author>
		<name>Craig L Russell</name>
	</author>
	<content type="html">Hi Amit,
&lt;br&gt;&lt;br&gt;Is the NoResultException the only exception in your transaction? If &amp;nbsp;
&lt;br&gt;so, I agree that this should not roll back the transaction. And please &amp;nbsp;
&lt;br&gt;file a JIRA for this.
&lt;br&gt;&lt;br&gt;&amp;quot;Surely there is a TCK test case&amp;quot; that covers this situation?
&lt;br&gt;&lt;br&gt;Craig
&lt;br&gt;&lt;br&gt;On Nov 21, 2009, at 6:25 AM, Amit Puri wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi All
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a weird problem out here which seems to be violating the JPA &amp;nbsp;
&lt;br&gt;&amp;gt; 1.0
&lt;br&gt;&amp;gt; specification.
&lt;br&gt;&amp;gt; One of my query which throws a NoResultException results in the &amp;nbsp;
&lt;br&gt;&amp;gt; complete
&lt;br&gt;&amp;gt; transaction being
&lt;br&gt;&amp;gt; rollled back.I find the following in JPA spec which clearly says that
&lt;br&gt;&amp;gt; NoResultException
&lt;br&gt;&amp;gt; should not result in a roll back.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For your reference here is the section 3.7 of JPA spec from my copy.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Section 3.7 of the JPA 1.0 spec states that:
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt; PersistenceException
&lt;br&gt;&amp;gt; The PersistenceException is thrown by the persistence provider when a
&lt;br&gt;&amp;gt; problem
&lt;br&gt;&amp;gt; occurs. It may be thrown to report that the invoked operation could &amp;nbsp;
&lt;br&gt;&amp;gt; not
&lt;br&gt;&amp;gt; complete because of an
&lt;br&gt;&amp;gt; unexpected error (e.g., failure of the persistence provider to open a
&lt;br&gt;&amp;gt; database connection).
&lt;br&gt;&amp;gt; All other exceptions defined by this specification are subclasses of &amp;nbsp;
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; PersistenceException.
&lt;br&gt;&amp;gt; All instances of PersistenceException except for instances of
&lt;br&gt;&amp;gt; NoResultException
&lt;br&gt;&amp;gt; and NonUniqueResultException will cause the current transaction,
&lt;br&gt;&amp;gt; if one is active, to be marked for rollback.
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here is the exception trace.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt; 2009-11-19 12:15:58,531 ERROR &amp;lt;openjpa-1.2.1-r2180:4612 nonfatal &amp;nbsp;
&lt;br&gt;&amp;gt; user error&amp;gt;
&lt;br&gt;&amp;gt; org.apache.openjpa.persistence.NoResultException: The query on &amp;nbsp;
&lt;br&gt;&amp;gt; candidate
&lt;br&gt;&amp;gt; type &amp;quot;class -------&amp;quot; with filter
&lt;br&gt;&amp;gt; &amp;quot;---------------------------------------------------&amp;quot; was configured &amp;nbsp;
&lt;br&gt;&amp;gt; to have
&lt;br&gt;&amp;gt; a unique result, but no instance matched the query.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;at &amp;nbsp;
&lt;br&gt;&amp;gt; org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1299)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java: 
&lt;br&gt;&amp;gt; 1221)
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; 2009-11-19 12:16:04,281 INFO &amp;nbsp;[Transaction] TX Required: Committing
&lt;br&gt;&amp;gt; transaction &amp;nbsp;
&lt;br&gt;&amp;gt; org.apache.geronimo.transaction.manager.TransactionImpl@4d004d
&lt;br&gt;&amp;gt; 2009-11-19 12:16:04,640 WARN &amp;nbsp;[Transaction] Unexpected exception from
&lt;br&gt;&amp;gt; beforeCompletion; transaction will roll back
&lt;br&gt;&amp;gt; &amp;lt;openjpa-1.2.1-r2180:4612 fatal general error&amp;gt;
&lt;br&gt;&amp;gt; org.apache.openjpa.persistence.PersistenceException: The transaction &amp;nbsp;
&lt;br&gt;&amp;gt; has
&lt;br&gt;&amp;gt; been rolled back. &amp;nbsp;See the nested exceptions for details on the &amp;nbsp;
&lt;br&gt;&amp;gt; errors that
&lt;br&gt;&amp;gt; occurred.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;at
&lt;br&gt;&amp;gt; org 
&lt;br&gt;&amp;gt; .apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java: 
&lt;br&gt;&amp;gt; 2163)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Please clarify.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; Amit
&lt;/div&gt;&lt;/div&gt;Craig L Russell
&lt;br&gt;Architect, Sun Java Enterprise System &lt;a href=&quot;http://db.apache.org/jdo&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://db.apache.org/jdo&lt;/a&gt;&lt;br&gt;408 276-5638 mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4043477&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;P.S. A good JDO? O, Gasp!
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://n2.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (3K) &lt;a href=&quot;http://n2.nabble.com/attachment/4043477/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/OpenJPA-1-2-1-violates-JPA-1-0-specification-tp4042748p4043477.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4042748"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4042748</id>
	<title>OpenJPA 1.2.1 violates JPA 1.0 specification</title>
	<published>2009-11-21T06:25:31Z</published>
	<updated>2009-11-21T06:25:31Z</updated>
	<author>
		<name>Amit Puri</name>
	</author>
	<content type="html">Hi All
&lt;br&gt;&lt;br&gt;I have a weird problem out here which seems to be violating the JPA 1.0
&lt;br&gt;specification.
&lt;br&gt;One of my query which throws a NoResultException results in the complete
&lt;br&gt;transaction being
&lt;br&gt;rollled back.I find the following in JPA spec which clearly says that
&lt;br&gt;NoResultException
&lt;br&gt;should not result in a roll back.
&lt;br&gt;&lt;br&gt;For your reference here is the section 3.7 of JPA spec from my copy.
&lt;br&gt;&lt;br&gt;Section 3.7 of the JPA 1.0 spec states that:
&lt;br&gt;------------------------------------------------------------------------------------------
&lt;br&gt;PersistenceException
&lt;br&gt;The PersistenceException is thrown by the persistence provider when a
&lt;br&gt;problem
&lt;br&gt;occurs. It may be thrown to report that the invoked operation could not
&lt;br&gt;complete because of an
&lt;br&gt;unexpected error (e.g., failure of the persistence provider to open a
&lt;br&gt;database connection).
&lt;br&gt;All other exceptions defined by this specification are subclasses of the
&lt;br&gt;PersistenceException.
&lt;br&gt;All instances of PersistenceException except for instances of
&lt;br&gt;NoResultException
&lt;br&gt;and NonUniqueResultException will cause the current transaction,
&lt;br&gt;if one is active, to be marked for rollback.
&lt;br&gt;-------------------------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Here is the exception trace.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------------------------
&lt;br&gt;2009-11-19 12:15:58,531 ERROR &amp;lt;openjpa-1.2.1-r2180:4612 nonfatal user error&amp;gt;
&lt;br&gt;org.apache.openjpa.persistence.NoResultException: The query on candidate
&lt;br&gt;type &amp;quot;class -------&amp;quot; with filter
&lt;br&gt;&amp;quot;---------------------------------------------------&amp;quot; was configured to have
&lt;br&gt;a unique result, but no instance matched the query.
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1299)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1221)
&lt;br&gt;...
&lt;br&gt;...
&lt;br&gt;2009-11-19 12:16:04,281 INFO &amp;nbsp;[Transaction] TX Required: Committing
&lt;br&gt;transaction org.apache.geronimo.transaction.manager.TransactionImpl@4d004d
&lt;br&gt;2009-11-19 12:16:04,640 WARN &amp;nbsp;[Transaction] Unexpected exception from
&lt;br&gt;beforeCompletion; transaction will roll back
&lt;br&gt;&amp;lt;openjpa-1.2.1-r2180:4612 fatal general error&amp;gt;
&lt;br&gt;org.apache.openjpa.persistence.PersistenceException: The transaction has
&lt;br&gt;been rolled back. &amp;nbsp;See the nested exceptions for details on the errors that
&lt;br&gt;occurred.
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2163)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
&lt;br&gt;-------------------------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Please clarify.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;Amit
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/OpenJPA-1-2-1-violates-JPA-1-0-specification-tp4042748p4042748.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4039863</id>
	<title>Re: Migration strategy from Hibernate</title>
	<published>2009-11-20T12:31:33Z</published>
	<updated>2009-11-20T12:31:33Z</updated>
	<author>
		<name>Sebastian Wagner</name>
	</author>
	<content type="html">wow, that is quite extended material, thanks for the link.
&lt;br&gt;I will study and come back.
&lt;br&gt;&lt;br&gt;&lt;br&gt;sebastian
&lt;br&gt;&lt;br&gt;2009/11/20 Kevin Sutter &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039863&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Sebastian,
&lt;br&gt;&amp;gt; I'm sorry to day that we don't have a cookbook on this Hibernate migration
&lt;br&gt;&amp;gt; exercise. &amp;nbsp;I would highly suggest (beg?) that you take good notes during
&lt;br&gt;&amp;gt; this migration so that we can all learn from the experience.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm assuming you are moving from Hibernate &amp;quot;classic&amp;quot;, meaning pre-JPA
&lt;br&gt;&amp;gt; programming model. &amp;nbsp;Otherwise known as the Hibernate Session programming
&lt;br&gt;&amp;gt; model. &amp;nbsp;If you are actually on moving from Hibernate JPA to OpenJPA, then
&lt;br&gt;&amp;gt; the migration should be relatively straight forward. &amp;nbsp;But, from the content
&lt;br&gt;&amp;gt; of your notes below, I believe you are migrating from &amp;quot;classic&amp;quot; to OpenJPA.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; To that end, a colleague of mine and myself have written a white paper [1]
&lt;br&gt;&amp;gt; outlining the common Hibernate &amp;quot;classic&amp;quot; programming model paradigms and
&lt;br&gt;&amp;gt; how
&lt;br&gt;&amp;gt; to best map them to OpenJPA. &amp;nbsp;So, I would start with that white paper and
&lt;br&gt;&amp;gt; see it gets you started.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also, OpenJPA supports both Annotations and XML, so if you feel more
&lt;br&gt;&amp;gt; comfortable with the XML configuration approach, you could stick with that.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I hope this helps.
&lt;br&gt;&amp;gt; Good luck and let us know how it goes!
&lt;br&gt;&amp;gt; Kevin
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [1]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 3:47 AM, Sebastian Wagner &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039863&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt;wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; hi,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; in follow up from a discussion on the Apache General List:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@mail.gmail.com%3E&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@...%3E&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I have some quite basic questions about migrating a existing Project
&lt;br&gt;&amp;gt; using
&lt;br&gt;&amp;gt; &amp;gt; Hibernate to openJPA.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; We are using a Hibernate 3.4 + XDoclet2 to generate the HBM files.
&lt;br&gt;&amp;gt; &amp;gt; We don't use a Spring Managed Transaction Manager yet for handling the
&lt;br&gt;&amp;gt; &amp;gt; Session (but we should).
&lt;br&gt;&amp;gt; &amp;gt; We have a lot of HQL Statements in the Code.
&lt;br&gt;&amp;gt; &amp;gt; The project is: &lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; (For anybody interested the Sources are located into
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; )
&lt;br&gt;&amp;gt; &amp;gt; And we are applying for Apache Incubation, so we have to get rid of
&lt;br&gt;&amp;gt; &amp;gt; Hibernate.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; What is your general advice on an easy way to migrate to openJPA?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Writing the intermediate database description per object, you use
&lt;br&gt;&amp;gt; &amp;gt; annotations I guess?
&lt;br&gt;&amp;gt; &amp;gt; In what kind of Java-Structure do you Map Many-To-One relations?
&lt;br&gt;&amp;gt; &amp;gt; How do you handle Multi-Threaded Applications and Database Caches? In
&lt;br&gt;&amp;gt; &amp;gt; hibernate a very common problem is that you have problems with Objects
&lt;br&gt;&amp;gt; that
&lt;br&gt;&amp;gt; &amp;gt; are several times in the Cache but in different Threads. In that case a
&lt;br&gt;&amp;gt; &amp;gt; Session.flush does not really work as it only flushs one Thread. This can
&lt;br&gt;&amp;gt; &amp;gt; be
&lt;br&gt;&amp;gt; &amp;gt; solved in Hibernate by using a Spring managed Transaction Manager. What
&lt;br&gt;&amp;gt; is
&lt;br&gt;&amp;gt; &amp;gt; JPAs approach in that area?
&lt;br&gt;&amp;gt; &amp;gt; And finally =&amp;gt; HQL Statements, I guess I have to rewrite them all, but is
&lt;br&gt;&amp;gt; &amp;gt; the openJPA *JPQL* very different from that? From what I have seen its
&lt;br&gt;&amp;gt; not
&lt;br&gt;&amp;gt; &amp;gt; that big Issue to refactor those statements to JPQL.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; And I have a lot more questions before I can finally decide on what is
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt; best and feasable way to migrate.
&lt;br&gt;&amp;gt; &amp;gt; But I am eager to learn ^^ so maybe somebody is eager to give us some
&lt;br&gt;&amp;gt; tipps
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I will try to study the docs,
&lt;br&gt;&amp;gt; &amp;gt; but i have not seen any kick-start example yet that covers the most of
&lt;br&gt;&amp;gt; &amp;gt; basic
&lt;br&gt;&amp;gt; &amp;gt; topics. Is there any sample that can be re-used?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; thanks a lot
&lt;br&gt;&amp;gt; &amp;gt; Sebastian Wagner
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt; Sebastian Wagner
&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://www.webbase-design.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.webbase-design.de&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://www.laszlo-forum.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.laszlo-forum.de&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039863&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Sebastian Wagner
&lt;br&gt;&lt;a href=&quot;http://www.webbase-design.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.webbase-design.de&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.laszlo-forum.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.laszlo-forum.de&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039863&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Migration-strategy-from-Hibernate-tp4037016p4039863.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4039747"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4039747</id>
	<title>Re: Migration strategy from Hibernate</title>
	<published>2009-11-20T12:02:36Z</published>
	<updated>2009-11-20T12:02:36Z</updated>
	<author>
		<name>Kevin Sutter</name>
	</author>
	<content type="html">Hi Sebastian,
&lt;br&gt;I'm sorry to day that we don't have a cookbook on this Hibernate migration
&lt;br&gt;exercise. &amp;nbsp;I would highly suggest (beg?) that you take good notes during
&lt;br&gt;this migration so that we can all learn from the experience.
&lt;br&gt;&lt;br&gt;I'm assuming you are moving from Hibernate &amp;quot;classic&amp;quot;, meaning pre-JPA
&lt;br&gt;programming model. &amp;nbsp;Otherwise known as the Hibernate Session programming
&lt;br&gt;model. &amp;nbsp;If you are actually on moving from Hibernate JPA to OpenJPA, then
&lt;br&gt;the migration should be relatively straight forward. &amp;nbsp;But, from the content
&lt;br&gt;of your notes below, I believe you are migrating from &amp;quot;classic&amp;quot; to OpenJPA.
&lt;br&gt;&lt;br&gt;To that end, a colleague of mine and myself have written a white paper [1]
&lt;br&gt;outlining the common Hibernate &amp;quot;classic&amp;quot; programming model paradigms and how
&lt;br&gt;to best map them to OpenJPA. &amp;nbsp;So, I would start with that white paper and
&lt;br&gt;see it gets you started.
&lt;br&gt;&lt;br&gt;Also, OpenJPA supports both Annotations and XML, so if you feel more
&lt;br&gt;comfortable with the XML configuration approach, you could stick with that.
&lt;br&gt;&lt;br&gt;I hope this helps.
&lt;br&gt;Good luck and let us know how it goes!
&lt;br&gt;Kevin
&lt;br&gt;&lt;br&gt;[1]
&lt;br&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 3:47 AM, Sebastian Wagner &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039747&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; in follow up from a discussion on the Apache General List:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@mail.gmail.com%3E&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@...%3E&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have some quite basic questions about migrating a existing Project using
&lt;br&gt;&amp;gt; Hibernate to openJPA.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We are using a Hibernate 3.4 + XDoclet2 to generate the HBM files.
&lt;br&gt;&amp;gt; We don't use a Spring Managed Transaction Manager yet for handling the
&lt;br&gt;&amp;gt; Session (but we should).
&lt;br&gt;&amp;gt; We have a lot of HQL Statements in the Code.
&lt;br&gt;&amp;gt; The project is: &lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&amp;gt; (For anybody interested the Sources are located into
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&lt;/a&gt;&lt;br&gt;&amp;gt; )
&lt;br&gt;&amp;gt; And we are applying for Apache Incubation, so we have to get rid of
&lt;br&gt;&amp;gt; Hibernate.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What is your general advice on an easy way to migrate to openJPA?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Writing the intermediate database description per object, you use
&lt;br&gt;&amp;gt; annotations I guess?
&lt;br&gt;&amp;gt; In what kind of Java-Structure do you Map Many-To-One relations?
&lt;br&gt;&amp;gt; How do you handle Multi-Threaded Applications and Database Caches? In
&lt;br&gt;&amp;gt; hibernate a very common problem is that you have problems with Objects that
&lt;br&gt;&amp;gt; are several times in the Cache but in different Threads. In that case a
&lt;br&gt;&amp;gt; Session.flush does not really work as it only flushs one Thread. This can
&lt;br&gt;&amp;gt; be
&lt;br&gt;&amp;gt; solved in Hibernate by using a Spring managed Transaction Manager. What is
&lt;br&gt;&amp;gt; JPAs approach in that area?
&lt;br&gt;&amp;gt; And finally =&amp;gt; HQL Statements, I guess I have to rewrite them all, but is
&lt;br&gt;&amp;gt; the openJPA *JPQL* very different from that? From what I have seen its not
&lt;br&gt;&amp;gt; that big Issue to refactor those statements to JPQL.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And I have a lot more questions before I can finally decide on what is the
&lt;br&gt;&amp;gt; best and feasable way to migrate.
&lt;br&gt;&amp;gt; But I am eager to learn ^^ so maybe somebody is eager to give us some tipps
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I will try to study the docs,
&lt;br&gt;&amp;gt; but i have not seen any kick-start example yet that covers the most of
&lt;br&gt;&amp;gt; basic
&lt;br&gt;&amp;gt; topics. Is there any sample that can be re-used?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; thanks a lot
&lt;br&gt;&amp;gt; Sebastian Wagner
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Sebastian Wagner
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.webbase-design.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.webbase-design.de&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.laszlo-forum.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.laszlo-forum.de&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4039747&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Migration-strategy-from-Hibernate-tp4037016p4039747.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4037016"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4037016</id>
	<title>Migration strategy from Hibernate</title>
	<published>2009-11-20T01:47:01Z</published>
	<updated>2009-11-20T01:47:01Z</updated>
	<author>
		<name>Sebastian Wagner</name>
	</author>
	<content type="html">hi,
&lt;br&gt;&lt;br&gt;&lt;br&gt;in follow up from a discussion on the Apache General List:
&lt;br&gt;&lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@mail.gmail.com%3E&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@...%3E&lt;/a&gt;&lt;br&gt;&lt;br&gt;I have some quite basic questions about migrating a existing Project using
&lt;br&gt;Hibernate to openJPA.
&lt;br&gt;&lt;br&gt;We are using a Hibernate 3.4 + XDoclet2 to generate the HBM files.
&lt;br&gt;We don't use a Spring Managed Transaction Manager yet for handling the
&lt;br&gt;Session (but we should).
&lt;br&gt;We have a lot of HQL Statements in the Code.
&lt;br&gt;The project is: &lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;(For anybody interested the Sources are located into
&lt;br&gt;&lt;a href=&quot;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/&lt;/a&gt;&lt;br&gt;)
&lt;br&gt;And we are applying for Apache Incubation, so we have to get rid of
&lt;br&gt;Hibernate.
&lt;br&gt;&lt;br&gt;What is your general advice on an easy way to migrate to openJPA?
&lt;br&gt;&lt;br&gt;Writing the intermediate database description per object, you use
&lt;br&gt;annotations I guess?
&lt;br&gt;In what kind of Java-Structure do you Map Many-To-One relations?
&lt;br&gt;How do you handle Multi-Threaded Applications and Database Caches? In
&lt;br&gt;hibernate a very common problem is that you have problems with Objects that
&lt;br&gt;are several times in the Cache but in different Threads. In that case a
&lt;br&gt;Session.flush does not really work as it only flushs one Thread. This can be
&lt;br&gt;solved in Hibernate by using a Spring managed Transaction Manager. What is
&lt;br&gt;JPAs approach in that area?
&lt;br&gt;And finally =&amp;gt; HQL Statements, I guess I have to rewrite them all, but is
&lt;br&gt;the openJPA *JPQL* very different from that? From what I have seen its not
&lt;br&gt;that big Issue to refactor those statements to JPQL.
&lt;br&gt;&lt;br&gt;And I have a lot more questions before I can finally decide on what is the
&lt;br&gt;best and feasable way to migrate.
&lt;br&gt;But I am eager to learn ^^ so maybe somebody is eager to give us some tipps
&lt;br&gt;&lt;br&gt;I will try to study the docs,
&lt;br&gt;but i have not seen any kick-start example yet that covers the most of basic
&lt;br&gt;topics. Is there any sample that can be re-used?
&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks a lot
&lt;br&gt;Sebastian Wagner
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Sebastian Wagner
&lt;br&gt;&lt;a href=&quot;http://www.webbase-design.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.webbase-design.de&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://openmeetings.googlecode.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openmeetings.googlecode.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.laszlo-forum.de&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.laszlo-forum.de&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4037016&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Migration-strategy-from-Hibernate-tp4037016p4037016.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4032228</id>
	<title>Re: Tx is rolling back after NoResultException in OpenJPA  1.2.1/Geronimo 2.1.4</title>
	<published>2009-11-19T06:55:11Z</published>
	<updated>2009-11-19T06:55:11Z</updated>
	<author>
		<name>Daryl Stultz</name>
	</author>
	<content type="html">On Thu, Nov 19, 2009 at 9:34 AM, Amit Puri &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032228&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hi All
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using Geronimo 2.1.4 that incorporates OpenJPA 1.2.1. In one of my
&lt;br&gt;&amp;gt; application, I am getting &amp;quot;NoResultException&amp;quot; from some query. After that
&lt;br&gt;&amp;gt; my
&lt;br&gt;&amp;gt; Transaction is rolling back and it gave exception there. I dont want it to
&lt;br&gt;&amp;gt; roll back, Please helping me by giving any pointer.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I don't know if this is the best way, but you could query.getResultList()
&lt;br&gt;instead and either find nothing or the first and only item in the list.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Daryl Stultz
&lt;br&gt;_____________________________________
&lt;br&gt;6 Degrees Software and Consulting, Inc.
&lt;br&gt;&lt;a href=&quot;http://www.6degrees.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.6degrees.com&lt;/a&gt;&lt;br&gt;mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032228&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Tx-is-rolling-back-after-NoResultException-in-OpenJPA-1-2-1-Geronimo-2-1-4-tp4032127p4032228.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4032127"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4032127</id>
	<title>Tx is rolling back after NoResultException in OpenJPA 1.2.1/Geronimo  2.1.4</title>
	<published>2009-11-19T06:34:46Z</published>
	<updated>2009-11-19T06:34:46Z</updated>
	<author>
		<name>Amit Puri</name>
	</author>
	<content type="html">Hi All
&lt;br&gt;&lt;br&gt;I am using Geronimo 2.1.4 that incorporates OpenJPA 1.2.1. In one of my
&lt;br&gt;application, I am getting &amp;quot;NoResultException&amp;quot; from some query. After that my
&lt;br&gt;Transaction is rolling back and it gave exception there. I dont want it to
&lt;br&gt;roll back, Please helping me by giving any pointer.
&lt;br&gt;&lt;br&gt;My logs are like that:
&lt;br&gt;&lt;br&gt;2009-11-19 12:15:58,531 ERROR &amp;lt;openjpa-1.2.1-r2180:4612 nonfatal user error&amp;gt;
&lt;br&gt;org.apache.openjpa.persistence.NoResultException: The query on candidate
&lt;br&gt;type &amp;quot;class -------&amp;quot; with filter
&lt;br&gt;&amp;quot;---------------------------------------------------&amp;quot; was configured to have
&lt;br&gt;a unique result, but no instance matched the query.
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1299)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1221)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:848)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:779)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:254)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:317)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at java.lang.reflect.Method.invoke(Method.java:599)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:210)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at java.lang.Thread.run(Thread.java:735)
&lt;br&gt;2009-11-19 12:16:04,281 INFO &amp;nbsp;[Transaction] TX Required: Committing
&lt;br&gt;transaction org.apache.geronimo.transaction.manager.TransactionImpl@4d004d
&lt;br&gt;2009-11-19 12:16:04,640 WARN &amp;nbsp;[Transaction] Unexpected exception from
&lt;br&gt;beforeCompletion; transaction will roll back
&lt;br&gt;&amp;lt;openjpa-1.2.1-r2180:4612 fatal general error&amp;gt;
&lt;br&gt;org.apache.openjpa.persistence.PersistenceException: The transaction has
&lt;br&gt;been rolled back. &amp;nbsp;See the nested exceptions for details on the errors that
&lt;br&gt;occurred.
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2163)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
&lt;br&gt;&amp;nbsp; &amp;nbsp; at
&lt;br&gt;org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks for your help.
&lt;br&gt;&lt;br&gt;Warm Regards,
&lt;br&gt;Amit Puri
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Tx-is-rolling-back-after-NoResultException-in-OpenJPA-1-2-1-Geronimo-2-1-4-tp4032127p4032127.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4031826</id>
	<title>Intermittent OptimisticException with Persist on many to many self  referencing entities.</title>
	<published>2009-11-19T05:39:36Z</published>
	<updated>2009-11-19T05:39:36Z</updated>
	<author>
		<name>അജിയോസ്‌ യോഹന്നാന്‍(Ajiyos)</name>
	</author>
	<content type="html">I have a self referencing table &amp;quot;PR_PARTNER&amp;quot; with ManyToMany relationship
&lt;br&gt;using a join table PR_CATLINK
&lt;br&gt;&lt;br&gt;*
&lt;br&gt;&lt;br&gt;public class _Partner implements Serializable {
&lt;br&gt;&lt;br&gt;.....
&lt;br&gt;&lt;br&gt;@Id
&lt;br&gt;@GeneratedValue(strategy=GenerationType.SEQUENCE, generator=&amp;quot;partnerSeqGen&amp;quot;)
&lt;br&gt;private int partnerId;
&lt;br&gt;&lt;br&gt;@Version
&lt;br&gt;&lt;br&gt;private int rowts;
&lt;br&gt;&lt;br&gt;@ManyToMany
&lt;br&gt;@JoinTable(name = &amp;quot;PR_PRCAT_LNK&amp;quot;, joinColumns = @JoinColumn(name =
&lt;br&gt;&amp;quot;PARTNERID&amp;quot;), inverseJoinColumns = @JoinColumn(name = &amp;quot;CATEGORYID&amp;quot;,
&lt;br&gt;referencedColumnName = &amp;quot;PARTNERID&amp;quot;))
&lt;br&gt;private Set&amp;lt;_Partner&amp;gt; categories = new HashSet&amp;lt;_Partner&amp;gt;();
&lt;br&gt;&lt;br&gt;@ManyToMany(mappedBy = &amp;quot;categories&amp;quot;)
&lt;br&gt;private Set&amp;lt;_Partner&amp;gt; members = new HashSet&amp;lt;_Partner&amp;gt;();
&lt;br&gt;}*
&lt;br&gt;I am using openjpa as standalone mode(not container managed) from servlet
&lt;br&gt;container.
&lt;br&gt;&lt;br&gt;I am invoking a servlet which persist the category with multiple members.
&lt;br&gt;On third/fourth invocation I am getting OptimisticException.
&lt;br&gt;I am not sharing the entitymanager
&lt;br&gt;I havent enabled the data cache
&lt;br&gt;*Observation* is that for the failing invocation, the version field is not
&lt;br&gt;updated for the children entities in the cache though the version is changed
&lt;br&gt;in the db.
&lt;br&gt;Logs:
&lt;br&gt;I
&lt;br&gt;&lt;br&gt;[11/18/09 11:51:16:671 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304453
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; executing prepstmnt 820523240 INSERT INTO PR_PARTNER
&lt;br&gt;(partnerId, categoryFlag, createdate, description, DISPLAYNAME, NAME,
&lt;br&gt;statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID,
&lt;br&gt;PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
&lt;br&gt;?, ?) [params=(int) 35, (int) 1, (Timestamp) 2009-11-18 11:51:16.218,
&lt;br&gt;(String) szjdfsd, (null) null, (String) today, (int) 0, (Timestamp)
&lt;br&gt;2009-11-18 11:51:16.218, (null) null, (int) 1, (int) 1, (null) null, (int)
&lt;br&gt;2, (null) null]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [16 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 13, (int) 6, (int) 12]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 9, (int) 8, (int) 8]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 16, (int) 3, (int) 15]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; executing batch prepstmnt 1573674444 UPDATE PR_PARTNER SET
&lt;br&gt;rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 16, (int) 3, (int)
&lt;br&gt;15]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 35]
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304469
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 35]
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 35]
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; executing batch prepstmnt 1636655501 INSERT INTO
&lt;br&gt;PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int)
&lt;br&gt;35]
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1849912899&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.JDBC - &amp;lt;t
&lt;br&gt;1346457665, conn 1849912899&amp;gt; [0 ms] commit
&lt;br&gt;[11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 62304485
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.JDBC - &amp;lt;t
&lt;br&gt;1346457665, conn 1849912899&amp;gt; [0 ms] close
&lt;br&gt;&lt;br&gt;03578 &amp;nbsp;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t
&lt;br&gt;267849719, conn 1874489274&amp;gt; executing prepstmnt 569385456 INSERT INTO
&lt;br&gt;PR_PARTNER (partnerId, categoryFlag, createdate, description, DISPLAYNAME,
&lt;br&gt;NAME, statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID,
&lt;br&gt;PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
&lt;br&gt;?, ?) [params=(int) 36, (int) 1, (Timestamp) 2009-11-18 11:57:55.406,
&lt;br&gt;(String) SDF, (null) null, (String) TodAY1, (int) 0, (Timestamp) 2009-11-18
&lt;br&gt;11:57:55.406, (null) null, (int) 1, (int) 1, (null) null, (int) 2, (null)
&lt;br&gt;null]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 2, (int) 4, (int) 1]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 14, (int) 6, (int) 13]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int) 9]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; executing batch prepstmnt 1833266501 UPDATE PR_PARTNER SET
&lt;br&gt;rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int)
&lt;br&gt;9]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 4, (int) 36]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 36]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 36]
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703578
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; executing batch prepstmnt 1238911448 INSERT INTO
&lt;br&gt;PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int)
&lt;br&gt;36]
&lt;br&gt;[11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703594
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.SQL - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [16 ms] spent
&lt;br&gt;[11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703594
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.JDBC - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] commit
&lt;br&gt;[11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr &amp;nbsp; &amp;nbsp; R 62703594
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 1] openjpa.jdbc.JDBC - &amp;lt;t 267849719,
&lt;br&gt;conn 1874489274&amp;gt; [0 ms] close
&lt;br&gt;&lt;br&gt;......
&lt;br&gt;&lt;br&gt;&lt;br&gt;[11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195360
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; executing prepstmnt 226364798 INSERT INTO PR_PARTNER
&lt;br&gt;(partnerId, categoryFlag, createdate, description, DISPLAYNAME, NAME,
&lt;br&gt;statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID,
&lt;br&gt;PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
&lt;br&gt;?, ?) [params=(int) 37, (int) 1, (Timestamp) 2009-11-18 12:06:07.187,
&lt;br&gt;(String) skfdsdf, (null) null, (String) today3, (int) 0, (Timestamp)
&lt;br&gt;2009-11-18 12:06:07.187, (null) null, (int) 1, (int) 1, (null) null, (int)
&lt;br&gt;2, (null) null]
&lt;br&gt;[11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195360
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195360
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 14, (int) 6, (int) 13]
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [15 ms] spent
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int) 9]
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts =
&lt;br&gt;? WHERE partnerId = ? AND rowts = ? [params=(int) 17, (int) 3, (int) 16]
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195375
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; executing batch prepstmnt 1446794812 UPDATE PR_PARTNER SET
&lt;br&gt;rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 17, (int) 3, (int)
&lt;br&gt;16]
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [32 ms] spent
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 37]
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 37]
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK
&lt;br&gt;(PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 37]
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; executing batch prepstmnt 1434604930 INSERT INTO
&lt;br&gt;PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int)
&lt;br&gt;37]
&lt;br&gt;[11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.jdbc.SQL - &amp;lt;t 1346457665,
&lt;br&gt;conn 1661494024&amp;gt; [0 ms] spent
&lt;br&gt;[11/18/09 12:06:07:640 GMT+05:30] 00000049 SystemErr &amp;nbsp; &amp;nbsp; R 63195407
&lt;br&gt;DataAccessLayer &amp;nbsp;TRACE &amp;nbsp;[WebContainer : 7] openjpa.Runtime - An exception
&lt;br&gt;occurred while ending the transaction. &amp;nbsp;This exception will be re-thrown.
&lt;br&gt;&amp;lt;openjpa-1.2.2-SNAPSHOT-r422266:778978M-OPENJPA-975 nonfatal store error&amp;gt;
&lt;br&gt;org.apache.openjpa.util.OptimisticException: Optimistic locking errors were
&lt;br&gt;detected when flushing to the data store. &amp;nbsp;The following objects may have
&lt;br&gt;been concurrently modified in another transaction:
&lt;br&gt;[com.ibm.bcgex.core.dal.model._Partner-6,
&lt;br&gt;com.ibm.bcgex.core.dal.model._Partner-8]
&lt;br&gt;&amp;nbsp;at
&lt;br&gt;org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2160)
&lt;br&gt;&amp;nbsp;at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
&lt;br&gt;&amp;nbsp;at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
&lt;br&gt;&amp;nbsp;at
&lt;br&gt;org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
&lt;br&gt;&amp;nbsp;at
&lt;br&gt;org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
&lt;br&gt;&amp;nbsp;at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
&lt;br&gt;&amp;nbsp;at
&lt;br&gt;org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
&lt;br&gt;&amp;nbsp;at
&lt;br&gt;org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Please help.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Ajiyos
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Intermittent-OptimisticException-with-Persist-on-many-to-many-self-referencing-entities-tp4031826p4031826.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4028405</id>
	<title>Out of bounds exception with fetch plan</title>
	<published>2009-11-18T13:21:30Z</published>
	<updated>2009-11-18T13:21:30Z</updated>
	<author>
		<name>Daryl Stultz</name>
	</author>
	<content type="html">Hello, I&amp;#39;m getting the following:&lt;br&gt;&lt;br&gt;&lt;div&gt;java.lang.ArrayIndexOutOfBoundsException: 2&lt;br&gt;at org.apache.openjpa.meta.ClassMetaData.getExtraFieldDataIndex(ClassMetaData.java:859)&lt;br&gt;at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:358)&lt;br&gt;
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:278)&lt;br&gt;at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)&lt;br&gt;at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)&lt;br&gt;
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:894)&lt;br&gt;at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:852)&lt;br&gt;at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:774)&lt;br&gt;at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:982)&lt;br&gt;
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:278)&lt;br&gt;at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2400)&lt;br&gt;at org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.loadEagerJoin(RelationFieldStrategy.java:541)&lt;br&gt;
at org.apache.openjpa.jdbc.meta.FieldMapping.loadEagerJoin(FieldMapping.java:807)-- &lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;ve attached a unit test that exposes it. I&amp;#39;ve done my best to pare things down but it seems anything else I remove makes it go away (there are several things that could be removed to make it go away). The unit test passes when the exception is thrown. &lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In short, this works:&lt;/div&gt;&lt;br&gt;Query query = em.createQuery(&amp;quot;select o from Case as o&amp;quot; +&lt;br&gt;    &amp;quot; left join fetch o.scheduledAssignments&amp;quot; +&lt;br&gt;    &amp;quot; where o.scheduleDay = :sd&amp;quot;);&lt;br&gt;
query.setParameter(&amp;quot;sd&amp;quot;, sd);&lt;br&gt;List&amp;lt;Case&amp;gt; allCases = query.getResultList();&lt;br&gt;&lt;br&gt;&lt;div&gt;But this doesn&amp;#39;t:&lt;/div&gt;&lt;div&gt;&lt;br&gt;Query query = em.createQuery(&amp;quot;select o from Case as o&amp;quot; +&lt;br&gt;    &amp;quot; where o.scheduleDay = :sd&amp;quot;);&lt;br&gt;
query.setParameter(&amp;quot;sd&amp;quot;, sd);&lt;br&gt;FetchPlan fetchPlan = ((QueryImpl) query).getFetchPlan();&lt;br&gt;fetchPlan.addField(Case.class, &amp;quot;scheduledAssignments&amp;quot;);&lt;br&gt;List&amp;lt;Case&amp;gt; allCases = query.getResultList();&lt;br&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;The test case runs against PostgreSQL. I would really appreciate it if someone could verify the test passes under some other database or if it fails, under PostgreSQL. Of course it would be even better if an OpenJPA expert could find the problem.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I will also accept suggestions for building a better unit test package.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks for your help.&lt;br&gt;&lt;div&gt;&lt;br&gt;Daryl Stultz&lt;br&gt;_____________________________________&lt;br&gt;6 Degrees Software and Consulting, Inc.&lt;br&gt;
&lt;div&gt;&lt;a href=&quot;http://www.6degrees.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.6degrees.com&lt;/a&gt;&lt;br&gt;mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4028405&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://n2.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;test.zip&lt;/strong&gt; (43K) &lt;a href=&quot;http://n2.nabble.com/attachment/4028405/0/test.zip&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Out-of-bounds-exception-with-fetch-plan-tp4028405p4028405.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4027822</id>
	<title>OpenJPA tutorial fo r the absolute beginner</title>
	<published>2009-11-18T11:38:02Z</published>
	<updated>2009-11-18T11:38:02Z</updated>
	<author>
		<name>Scott Quint</name>
	</author>
	<content type="html">IBM WebSphere has just released an Alpha for their implementation of OpenJPA 2.0 for WebSphere and has released a tutorial for beginners. The tutorial is really for someone that has never used OpenJPA and it really does not require WebShpere.I know that when I was trying to use OpenJPA for the first time, I wished I could find a tutorial exactly like this.
&lt;br&gt;&lt;a href=&quot;http://bit.ly/IBMWASOpenJPATutorial&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;OpenJPA tutorial at IBM Alpha site&lt;/a&gt;&lt;br&gt;&lt;br&gt;It requires a free registration&lt;div class=&quot;signature&quot;&gt;Scott Quint
&lt;br&gt;IBM Websphere Technology Evangelist
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/OpenJPA-tutorial-fo-r-the-absolute-beginner-tp4027822p4027822.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4024587</id>
	<title>RE: Deleting a persistant object not resulting exception but not deleting  the data from database table</title>
	<published>2009-11-18T02:38:17Z</published>
	<updated>2009-11-18T02:38:17Z</updated>
	<author>
		<name>Michael Vorburger-4</name>
	</author>
	<content type="html">Balu,
&lt;br&gt;&lt;br&gt;Your description isn't very clear, your &amp;quot;making the object persistant&amp;quot;
&lt;br&gt;using findById?! &amp;nbsp;and your remove() results in an
&lt;br&gt;&amp;quot;IllegalArgumentException: Removing a detached instance&amp;quot; or &amp;quot;does not
&lt;br&gt;result any exception&amp;quot; ?
&lt;br&gt;&lt;br&gt;If you ARE trying to do em.remove() on a detached entity, what may work
&lt;br&gt;(I have not tried it) is to use a
&lt;br&gt;getJpaTemplate().remove(getJpaTemplate().getReference(EmailerSchedulerEn
&lt;br&gt;tity.class, emailerScheduler.getId())) kind of approach.
&lt;br&gt;&lt;br&gt;Regards.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: baluji [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4024587&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Wednesday, November 18, 2009 8:35 AM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4024587&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: Deleting a persistant object not resulting exception but not
&lt;br&gt;deleting the data from database table
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;hi,
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; I am trying delete a detached instance resulting 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Caused by: java.lang.IllegalArgumentException: Removing a detached
&lt;br&gt;instance
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; I am making the object persistant by using the method
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; emailerScheduler= this.findById(emailScheduler.getId());
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; validating whether the object is persistant by using the following
&lt;br&gt;method that returns true.
&lt;br&gt;&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; getJpaTemplate().contains(emailerScheduler);
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; and then removing the object 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;getJpaTemplate().remove(emailerScheduler); &amp;nbsp; &amp;nbsp;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; this does not result any exception.But it does not result deletion
&lt;br&gt;of the data from database.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;any help will be &amp;nbsp;appreciated.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;Balu
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;View this message in context:
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/Deleting-a-persistant-object-not-resulting-exceptio&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Deleting-a-persistant-object-not-resulting-exceptio&lt;/a&gt;&lt;br&gt;n-but-not-deleting-the-data-from-database-table-tp4023833p4023833.html
&lt;br&gt;Sent from the OpenJPA Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;____________________________________________________________
&lt;br&gt;&lt;br&gt; This email and any files transmitted with it are CONFIDENTIAL and intended
&lt;br&gt;&amp;nbsp; solely for the use of the individual or entity to which they are addressed.
&lt;br&gt; Any unauthorized copying, disclosure, or distribution of the material within
&lt;br&gt;&amp;nbsp; this email is strictly forbidden.
&lt;br&gt; Any views or opinions presented within this e-mail are solely those of the
&lt;br&gt;&amp;nbsp; author and do not necessarily represent those of Odyssey Financial
&lt;br&gt;Technologies SA unless otherwise specifically stated.
&lt;br&gt; An electronic message is not binding on its sender. Any message referring to
&lt;br&gt;&amp;nbsp; a binding engagement must be confirmed in writing and duly signed.
&lt;br&gt; If you have received this email in error, please notify the sender immediately
&lt;br&gt;&amp;nbsp; and delete the original.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Deleting-a-persistant-object-not-resulting-exception-but-not-deleting-the-data-from-database-table-tp4023833p4024587.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4023833"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4023833</id>
	<title>Deleting a persistant object not resulting exception but not deleting  the data from database table</title>
	<published>2009-11-17T23:34:44Z</published>
	<updated>2009-11-17T23:34:44Z</updated>
	<author>
		<name>baluji</name>
	</author>
	<content type="html">&amp;nbsp; &amp;nbsp;hi,
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; I am trying delete a detached instance resulting 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;i&gt;Caused by: java.lang.IllegalArgumentException: Removing a detached instance&lt;/i&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; I am making the object persistant by using the method
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&lt;i&gt;&amp;nbsp;emailerScheduler= this.findById(emailScheduler.getId())&lt;/i&gt;;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; validating whether the object is persistant by using the following method that returns true.
&lt;br&gt;&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&amp;nbsp; &lt;i&gt;&amp;nbsp; getJpaTemplate().contains(emailerScheduler);&lt;/i&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; and then removing the object 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;i&gt;&amp;nbsp;getJpaTemplate().remove(emailerScheduler)&lt;/i&gt;; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; this does not result any exception.But it does not result deletion of the data from database.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;any help will be &amp;nbsp;appreciated.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;Balu
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Deleting-a-persistant-object-not-resulting-exception-but-not-deleting-the-data-from-database-table-tp4023833p4023833.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4024423</id>
	<title>RE: Generate .java Files from ora.xml?</title>
	<published>2009-11-18T01:57:50Z</published>
	<updated>2009-11-18T01:57:50Z</updated>
	<author>
		<name>Michael Vorburger-4</name>
	</author>
	<content type="html">Thomas, 
&lt;br&gt;&lt;br&gt;I think you would have to hack this yourself.. probably using any
&lt;br&gt;Template Engine (&lt;a href=&quot;http://de.wikipedia.org/wiki/Template_Engine&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://de.wikipedia.org/wiki/Template_Engine&lt;/a&gt;) such as
&lt;br&gt;e.g. &amp;nbsp;&lt;a href=&quot;http://freemarker.sourceforge.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://freemarker.sourceforge.net/&lt;/a&gt;, or
&lt;br&gt;&lt;a href=&quot;http://wiki.eclipse.org/Xpand&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.eclipse.org/Xpand&lt;/a&gt;. &amp;nbsp;
&lt;br&gt;&lt;br&gt;For example, we (at work) have built a fairly extensive generator of
&lt;br&gt;.java JPA Entity classes, from some older in-house model (not an ora.xml
&lt;br&gt;like you are looking for) using Xpand. &amp;nbsp;As have many others of course,
&lt;br&gt;e.g. &lt;a href=&quot;http://www.fornax-platform.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.fornax-platform.org/&lt;/a&gt;&amp;nbsp;may interest you.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Michael Vorburger
&lt;br&gt;Development Manager, Design Studio
&lt;br&gt;Odyssey Financial Technologies
&lt;br&gt;&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: Thomas Polliard [mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4024423&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;] 
&lt;br&gt;Sent: Wednesday, November 18, 2009 1:42 AM
&lt;br&gt;To: &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4024423&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;Subject: Generate .java Files from ora.xml?
&lt;br&gt;&lt;br&gt;&lt;br&gt;I have scoured the documentation and I see that the MappingTool works
&lt;br&gt;for creating schema and the Reverse takes a schema and generates .java
&lt;br&gt;files but if I create the ora.xml file and put my mappings in their then
&lt;br&gt;is there no way to generate the .java files from it. &amp;nbsp;This would put the
&lt;br&gt;mapping into one place and would only require a codegen from ora.xml and
&lt;br&gt;schema-create from ora.xml. &amp;nbsp;This would keep the mappings in one place
&lt;br&gt;and allow there to be no disconnect from mappings.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;Thomas Polliard
&lt;br&gt;--
&lt;br&gt;View this message in context:
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/Generate-java-Files-from-ora-xml-tp4022362p4022362&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Generate-java-Files-from-ora-xml-tp4022362p4022362&lt;/a&gt;.
&lt;br&gt;html
&lt;br&gt;Sent from the OpenJPA Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;____________________________________________________________
&lt;br&gt;&lt;br&gt; This email and any files transmitted with it are CONFIDENTIAL and intended
&lt;br&gt;&amp;nbsp; solely for the use of the individual or entity to which they are addressed.
&lt;br&gt; Any unauthorized copying, disclosure, or distribution of the material within
&lt;br&gt;&amp;nbsp; this email is strictly forbidden.
&lt;br&gt; Any views or opinions presented within this e-mail are solely those of the
&lt;br&gt;&amp;nbsp; author and do not necessarily represent those of Odyssey Financial
&lt;br&gt;Technologies SA unless otherwise specifically stated.
&lt;br&gt; An electronic message is not binding on its sender. Any message referring to
&lt;br&gt;&amp;nbsp; a binding engagement must be confirmed in writing and duly signed.
&lt;br&gt; If you have received this email in error, please notify the sender immediately
&lt;br&gt;&amp;nbsp; and delete the original.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Generate-java-Files-from-ora-xml-tp4022362p4024423.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4022362"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4022362</id>
	<title>Generate .java Files from ora.xml?</title>
	<published>2009-11-17T16:42:10Z</published>
	<updated>2009-11-17T16:42:10Z</updated>
	<author>
		<name>Thomas Polliard</name>
	</author>
	<content type="html">I have scoured the documentation and I see that the MappingTool works for creating schema and the Reverse takes a schema and generates .java files but if I create the ora.xml file and put my mappings in their then is there no way to generate the .java files from it. &amp;nbsp;This would put the mapping into one place and would only require a codegen from ora.xml and schema-create from ora.xml. &amp;nbsp;This would keep the mappings in one place and allow there to be no disconnect from mappings.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;Thomas Polliard</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Generate-java-Files-from-ora-xml-tp4022362p4022362.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4019051</id>
	<title>collection null although initialized</title>
	<published>2009-11-17T06:58:58Z</published>
	<updated>2009-11-17T06:58:58Z</updated>
	<author>
		<name>Michael Simons</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;Given two classes like:
&lt;br&gt;class A {
&lt;br&gt;&amp;nbsp; Set&amp;lt;B&amp;gt; members = new HashSet&amp;lt;B&amp;gt;(13); // We initialize the set
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;nbsp; Map&amp;lt;String,String&amp;gt; getMembersMap() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; Map&amp;lt;String,String&amp;gt; m = new HashMap&amp;lt;String, String&amp;gt;(members.size()); // We get a NPE here!
&lt;br&gt;&amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; return m;
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;class B {...}
&lt;br&gt;&lt;br&gt;Is this a known issue?
&lt;br&gt;Do we have to always check for a null collection even if we initialized it?
&lt;br&gt;&lt;br&gt;kind regards,
&lt;br&gt;Michael
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/collection-null-although-initialized-tp4019051p4019051.html" />
	
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4019584</id>
	<title>Re: How work around OpenJPA-1365</title>
	<published>2009-11-17T08:28:26Z</published>
	<updated>2009-11-17T08:28:26Z</updated>
	<author>
		<name>Michael Simons</name>
	</author>
	<content type="html">Daryl Stultz schrieb:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, Nov 17, 2009 at 9:27 AM, Michael Simons
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4019584&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; You state, that you're query with distinct and join fetch does work
&lt;br&gt;&amp;gt;&amp;gt; properly. But this would
&lt;br&gt;&amp;gt;&amp;gt; mean OpenJPA-1365 doesn't occur, does it?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The JIRA states:
&lt;br&gt;&amp;gt; This issue occurs if the proposed fix for OPENJPA-894 is in place.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So 1365 does not occur unless you've patched your code such that 894 is
&lt;br&gt;&amp;gt; fixed. What version of OpenJPA are you using and do you have any patches in
&lt;br&gt;&amp;gt; place?
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;/div&gt;We are using OpenJPA 1.2.1; AFAIK we do not have 894 patch. But we do have the same behaviour as
&lt;br&gt;described in 1365.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; When we call &amp;quot;select a from A a join fetch B&amp;quot; we get n instances of A, with
&lt;br&gt;&amp;gt;&amp;gt; n = numbers of
&lt;br&gt;&amp;gt;&amp;gt; A-B-associations.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is the correct behavior. I have found with OpenJPA 1.2.1, I get
&lt;br&gt;&amp;gt; distinct rows of A which sounds like what you (and I) want but is improper.
&lt;br&gt;&amp;gt; 894 shows that a second run of the query in the same EntityManager yields
&lt;br&gt;&amp;gt; duplicates A's (with LEFT JOIN FETCH). What happens when you do this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; select distinct a from A a join fetch a.bs
&lt;br&gt;&amp;gt; ?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; How about these two:
&lt;br&gt;&amp;gt; select a from A a left join fetch a.bs
&lt;br&gt;&amp;gt; select distinct a from A a left join fetch a.bs
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I don't want to give the impression that I'm an expert on the matter, just
&lt;br&gt;&amp;gt; that I've dealt with this issue and I want to be sure my understanding of
&lt;br&gt;&amp;gt; things is accurate.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;mit freundlichen Grüßen,
&lt;br&gt;Michael Simons
&lt;br&gt;&lt;br&gt;OPTITOOL GmbH
&lt;br&gt;Bruderwöhrdstr. 15b
&lt;br&gt;93055 Regensburg
&lt;br&gt;Tel: +49(0)941.595780
&lt;br&gt;Fax: +49(0)941.595787
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-work-around-OpenJPA-1365-tp4017737p4019584.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4018985"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4023270</id>
	<title>Re: How work around OpenJPA-1365</title>
	<published>2009-11-17T19:57:46Z</published>
	<updated>2009-11-17T19:57:46Z</updated>
	<author>
		<name>Pinaki Poddar</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&amp;nbsp; OpenJPA FetchPlan is a more flexible and clear solution than JPA FETCH JOIN, imo. As you are moving from JDO, you will find FetchPlan familiar as it was originally part of JDO specification. The quick way to &amp;nbsp;
&lt;br&gt;control complex fetch is to
&lt;br&gt;&amp;nbsp; EntityManager em = ...;
&lt;br&gt;&amp;nbsp; OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
&lt;br&gt;&amp;nbsp; FetchPlan plan = oem.getFetchPlan();
&lt;br&gt;&lt;br&gt;// now on the plan interface you can add/reove named groups of attributes (called Fetch Group), add/remove specific fields, set maximum depth of traversal or recursion, or locking mode &amp;nbsp;etc.
&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Michael Simons wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hi Mike,
&lt;br&gt;&lt;br&gt;Do you mean fetchplan like described in the manual in chapter 1.7.4?
&lt;br&gt;Or is there a possibility to use JDO-FetchPlan with OpenJPA? If so, is there a description, how
&lt;br&gt;to do that?
&lt;br&gt;&lt;br&gt;kind regards,
&lt;br&gt;Michael
&lt;br&gt;&lt;br&gt;Michael Dick schrieb:
&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Daryl's correct, the duplicates returned by a JOIN FETCH clause are correct
&lt;br&gt;&amp;gt; behavior. If you don't want the duplicates to be returned you should use the
&lt;br&gt;&amp;gt; DISTINCT keyword and OpenJPA will remove duplicates from the list.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There are several outstanding issues though (which I'm working on):
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1.) OPENJPA-894: &amp;nbsp;When results are returned from the database OpenJPA
&lt;br&gt;&amp;gt; automatically removes duplicates from the list. If the results are fetched
&lt;br&gt;&amp;gt; from memory the duplicates reappear.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2.) OPENJPA-1365: After you apply the fix for OPENJPA-894 the distinct
&lt;br&gt;&amp;gt; keyword doesn't work. This is because OpenJPA merely prepends the DISTINCT
&lt;br&gt;&amp;gt; keyword to the SQL generated which doesn't work if you're selecting across
&lt;br&gt;&amp;gt; multiple tables. Instead we need to filter the result list after retrieving
&lt;br&gt;&amp;gt; from the database.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There are two proposed fixes for OPENJPA-894 each of which have some
&lt;br&gt;&amp;gt; drawbacks.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 3a.) Mike's fix : supports pagination but does not support multiple JOIN
&lt;br&gt;&amp;gt; FETCH statements (ie SELECT m FROM Manager m JOIN FETCH m.employees JOIN
&lt;br&gt;&amp;gt; FETCH m.projects returns the wrong number of results).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 3b.) Fay's fix : supported multiple JOIN FETCH statements, but does not
&lt;br&gt;&amp;gt; support pagination (ie query.setMaxResults(), query.setFirstResult() doesn't
&lt;br&gt;&amp;gt; page forward as expected).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So there is work being done, but it's turned out to be a very ticklish issue
&lt;br&gt;&amp;gt; to solve.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; At the risk of muddying the waters a bit if you're migrating a JDO
&lt;br&gt;&amp;gt; application have you considered using OpenJPA's FetchPlan implementation to
&lt;br&gt;&amp;gt; eagerly load some fields? Over medium - large datasets I've found this to be
&lt;br&gt;&amp;gt; significantly faster than using a JOIN FETCH, but YMMV.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hope this helps,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -mike
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Tue, Nov 17, 2009 at 8:48 AM, Daryl Stultz &amp;lt;daryl@6degrees.com&amp;gt; wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; On Tue, Nov 17, 2009 at 9:27 AM, Michael Simons
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;michael.simons@optitool.de&amp;gt;wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; You state, that you're query with distinct and join fetch does work
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; properly. But this would
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; mean OpenJPA-1365 doesn't occur, does it?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The JIRA states:
&lt;br&gt;&amp;gt;&amp;gt; This issue occurs if the proposed fix for OPENJPA-894 is in place.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So 1365 does not occur unless you've patched your code such that 894 is
&lt;br&gt;&amp;gt;&amp;gt; fixed. What version of OpenJPA are you using and do you have any patches in
&lt;br&gt;&amp;gt;&amp;gt; place?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; When we call &amp;quot;select a from A a join fetch B&amp;quot; we get n instances of A,
&lt;br&gt;&amp;gt;&amp;gt; with
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; n = numbers of
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; A-B-associations.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This is the correct behavior. I have found with OpenJPA 1.2.1, I get
&lt;br&gt;&amp;gt;&amp;gt; distinct rows of A which sounds like what you (and I) want but is improper.
&lt;br&gt;&amp;gt;&amp;gt; 894 shows that a second run of the query in the same EntityManager yields
&lt;br&gt;&amp;gt;&amp;gt; duplicates A's (with LEFT JOIN FETCH). What happens when you do this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; select distinct a from A a join fetch a.bs
&lt;br&gt;&amp;gt;&amp;gt; ?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; How about these two:
&lt;br&gt;&amp;gt;&amp;gt; select a from A a left join fetch a.bs
&lt;br&gt;&amp;gt;&amp;gt; select distinct a from A a left join fetch a.bs
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I don't want to give the impression that I'm an expert on the matter, just
&lt;br&gt;&amp;gt;&amp;gt; that I've dealt with this issue and I want to be sure my understanding of
&lt;br&gt;&amp;gt;&amp;gt; things is accurate.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; Daryl Stultz
&lt;br&gt;&amp;gt;&amp;gt; _____________________________________
&lt;br&gt;&amp;gt;&amp;gt; 6 Degrees Software and Consulting, Inc.
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.6degrees.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.6degrees.com&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; mailto:daryl@6degrees.com
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;div class=&quot;signature&quot;&gt;Pinaki &lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-work-around-OpenJPA-1365-tp4017737p4023270.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4019842"/>
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-4032548</id>
	<title>Re: How work around OpenJPA-1365</title>
	<published>2009-11-19T07:43:59Z</published>
	<updated>2009-11-19T07:43:59Z</updated>
	<author>
		<name>Michael Dick</name>
	</author>
	<content type="html">Hi Michael,
&lt;br&gt;&lt;br&gt;I think there are two issues here.
&lt;br&gt;&lt;br&gt;1. The FetchPlan implementation with OpenJPA doesn't generate JOIN FETCH
&lt;br&gt;statements like you're expecting. As far as I know the only way to get the
&lt;br&gt;behavior you're looking for is to put the JOIN FETCH clause in your JPQL
&lt;br&gt;statement itself.
&lt;br&gt;&lt;br&gt;2. OpenJPA's query engine translates multiple JOIN FETCH clauses into
&lt;br&gt;separate statements. I'm not sure why this was done or what it would take to
&lt;br&gt;fix it, but at first glance that looks like the reason why your query :
&lt;br&gt;&amp;quot;SELECT p from Product p JOIN FETCH p.displayOptions JOIN FETCH p.locals&amp;quot;
&lt;br&gt;generates so many SQL statements..
&lt;br&gt;&lt;br&gt;The merit of issue 1 may depend on your environment. I've seen multiple
&lt;br&gt;statements perform signifcantly better than a JOIN FETCH approach when
&lt;br&gt;paired with OpenJPA's Large ResultSets. Your mileage may vary of course.
&lt;br&gt;&lt;br&gt;I'd have to dig in to the multiple statements aspect of issue 2. If it is a
&lt;br&gt;result of splitting multiple JOIN FETCHes into multiple SQL statements I
&lt;br&gt;suspect it'll be very involved to 'fix'. I could be pleasantly surprised
&lt;br&gt;though.
&lt;br&gt;&lt;br&gt;-mike
&lt;br&gt;&lt;br&gt;On Thu, Nov 19, 2009 at 3:46 AM, Michael Simons
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032548&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello Mike,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My Model:
&lt;br&gt;&amp;gt; Product(1:*)LocalizedProduct
&lt;br&gt;&amp;gt; Product(1:*)ProductDisplayOption
&lt;br&gt;&amp;gt; ProductDisplayOption extends DisplayOption
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've setup a FetchPlan with this:
&lt;br&gt;&amp;gt; @FetchGroups({
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@FetchGroup(name=&amp;quot;productDetails&amp;quot;, attributes={
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@FetchAttribute(name=&amp;quot;locals&amp;quot;),
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;@FetchAttribute(name=&amp;quot;displayOptions&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;})
&lt;br&gt;&amp;gt; })
&lt;br&gt;&amp;gt; public class Product implements java.io.Serializable, SingleLocalized,
&lt;br&gt;&amp;gt; Customizable {
&lt;br&gt;&amp;gt; &amp;nbsp;/** Localizations */
&lt;br&gt;&amp;gt; &amp;nbsp;@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY,
&lt;br&gt;&amp;gt; mappedBy=&amp;quot;product&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp;private Set&amp;lt;LocalizedProduct&amp;gt; locals = new HashSet&amp;lt;LocalizedProduct&amp;gt; (13);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY,
&lt;br&gt;&amp;gt; mappedBy=&amp;quot;product&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp;private Set&amp;lt;ProductDisplayOption&amp;gt; displayOptions = new
&lt;br&gt;&amp;gt; HashSet&amp;lt;ProductDisplayOption&amp;gt; (113);
&lt;br&gt;&amp;gt; &amp;nbsp;...
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When running the following code:
&lt;br&gt;&amp;gt; &amp;nbsp;private void retrieveProducts (ISentinel cache) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Query query = em.createQuery (&amp;quot;SELECT p from Product p&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;OpenJPAQuery oq = OpenJPAPersistence.cast (query);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;oq.getFetchPlan ().setMaxFetchDepth (10).addFetchGroup
&lt;br&gt;&amp;gt; (&amp;quot;productDetails&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;for (Object obj : query.getResultList ()) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Unfortunately the produced SQL looks like this:
&lt;br&gt;&amp;gt; SELECT t0.product_id, t0.jdo_version, t0.alt_ex_id, t0.density, t0.ext_id,
&lt;br&gt;&amp;gt; t0.indefinite FROM
&lt;br&gt;&amp;gt; product t0
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT t1.display_option_id, t0.display_option_id, t1.jdo_version,
&lt;br&gt;&amp;gt; t1.display_color, ...
&lt;br&gt;&amp;gt; FROM product_display_option t0 INNER JOIN display_option t1 ON
&lt;br&gt;&amp;gt; t0.display_option_id =
&lt;br&gt;&amp;gt; t1.display_option_id
&lt;br&gt;&amp;gt; WHERE t0.product_id = ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT t0.localized_product_id, t0.jdo_version, t0.description,
&lt;br&gt;&amp;gt; t0.lnguage_id, t0.product_id
&lt;br&gt;&amp;gt; FROM localized_product t0 WHERE t0.product_id = ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT t1.display_option_id, t0.display_option_id, t1.jdo_version,
&lt;br&gt;&amp;gt; t1.display_color, ...
&lt;br&gt;&amp;gt; FROM product_display_option t0 INNER JOIN display_option t1 ON
&lt;br&gt;&amp;gt; t0.display_option_id =
&lt;br&gt;&amp;gt; t1.display_option_id
&lt;br&gt;&amp;gt; WHERE t0.product_id = ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT t0.localized_product_id, t0.jdo_version, t0.description,
&lt;br&gt;&amp;gt; t0.lnguage_id, t0.product_id
&lt;br&gt;&amp;gt; FROM localized_product t0 WHERE t0.product_id = ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ... // the second and third statement are repeated for every record in the
&lt;br&gt;&amp;gt; product table.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I would expect (and got with the formerly used JDO Impl) is like this:
&lt;br&gt;&amp;gt; SELECT ...
&lt;br&gt;&amp;gt; FROM product t0
&lt;br&gt;&amp;gt; LEFT JOIN product_display_option t1 on t1.product_id = t0.product_id
&lt;br&gt;&amp;gt; JOIN display_option t2 on t2.display_option_id = t1.display_option_id;
&lt;br&gt;&amp;gt; SELECT ...
&lt;br&gt;&amp;gt; FROM product t0
&lt;br&gt;&amp;gt; LEFT JOIN localized_product t1 on t1.product_id = t0.product_id;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; So how do I convince OpenJPA to join the tables when using fetchplan?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When I run the following code instead without a fetchplan:
&lt;br&gt;&amp;gt; &amp;nbsp;private void retrieveProducts (ISentinel cache) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Query query = em.createQuery (
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;SELECT p from Product p JOIN FETCH p.displayOptions JOIN FETCH
&lt;br&gt;&amp;gt; p.locals&amp;quot;);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;for (Object obj : query.getResultList ()) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The produced SQL looks like (what's more like what I would have expected,
&lt;br&gt;&amp;gt; but still produces too
&lt;br&gt;&amp;gt; much &amp;quot;single selects&amp;quot;):
&lt;br&gt;&amp;gt; SELECT ...
&lt;br&gt;&amp;gt; FROM product t0
&lt;br&gt;&amp;gt; INNER JOIN product_display_option t1 ON t0.product_id = t1.product_id
&lt;br&gt;&amp;gt; INNER JOIN display_option t2 ON t1.display_option_id = t2.display_option_id
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT t0.localized_product_id, t0.jdo_version, t0.description,
&lt;br&gt;&amp;gt; t0.lnguage_id, t0.product_id
&lt;br&gt;&amp;gt; FROM localized_product t0
&lt;br&gt;&amp;gt; WHERE t0.product_id = ?
&lt;br&gt;&amp;gt; ... // The last statement again is executed for every record in the product
&lt;br&gt;&amp;gt; table.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How can I reduce the number of statements generated?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; kind regards,
&lt;br&gt;&amp;gt; Michael
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Michael Dick schrieb:
&lt;br&gt;&amp;gt; &amp;gt; Hi Michael,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Regarding seeing OPENJPA-1365 on 'vanilla' OpenJPA 1.2.1, I'll have to
&lt;br&gt;&amp;gt; take
&lt;br&gt;&amp;gt; &amp;gt; a look at that. It probably happens if the query does not fetch records
&lt;br&gt;&amp;gt; from
&lt;br&gt;&amp;gt; &amp;gt; the database. If that's what you're seeing then I just need to update the
&lt;br&gt;&amp;gt; &amp;gt; JIRA with that info.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I'm not terribly familiar with JDO. I was under the impression that
&lt;br&gt;&amp;gt; &amp;gt; OpenJPA's FetchPlans were identical (or nearly identical) to those in
&lt;br&gt;&amp;gt; JDO.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; To use my example (Employee and Manager) you would do something like this
&lt;br&gt;&amp;gt; :
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; OpenJPAEntityManager em = getEntityManager();
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; OpenJPAQuery q = em.createQuery(&amp;quot;SELECT m from Manager m &amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; q.getFetchPlan().addField(Manager.class, &amp;quot;employees&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; List&amp;lt;Manager&amp;gt; managers = q.getResultList();
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; There's a lot more in the manual about it, I'd start looking at [1].
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; [1]
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/manual.html#ref_guide_fetch&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/manual.html#ref_guide_fetch&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Hope this helps,
&lt;br&gt;&amp;gt; &amp;gt; -mike
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; On Tue, Nov 17, 2009 at 11:02 AM, Michael Simons &amp;lt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032548&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Hi Mike,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Do you mean fetchplan like described in the manual in chapter 1.7.4?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Or is there a possibility to use JDO-FetchPlan with OpenJPA? If so, is
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; there a description, how
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; to do that?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; kind regards,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Michael
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Michael Dick schrieb:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Daryl's correct, the duplicates returned by a JOIN FETCH clause are
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; correct
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; behavior. If you don't want the duplicates to be returned you should
&lt;br&gt;&amp;gt; use
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; DISTINCT keyword and OpenJPA will remove duplicates from the list.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; There are several outstanding issues though (which I'm working on):
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 1.) OPENJPA-894: &amp;nbsp;When results are returned from the database OpenJPA
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; automatically removes duplicates from the list. If the results are
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; fetched
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; from memory the duplicates reappear.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 2.) OPENJPA-1365: After you apply the fix for OPENJPA-894 the distinct
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; keyword doesn't work. This is because OpenJPA merely prepends the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; DISTINCT
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; keyword to the SQL generated which doesn't work if you're selecting
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; across
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; multiple tables. Instead we need to filter the result list after
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; retrieving
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; from the database.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; There are two proposed fixes for OPENJPA-894 each of which have some
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; drawbacks.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 3a.) Mike's fix : supports pagination but does not support multiple
&lt;br&gt;&amp;gt; JOIN
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; FETCH statements (ie SELECT m FROM Manager m JOIN FETCH m.employees
&lt;br&gt;&amp;gt; JOIN
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; FETCH m.projects returns the wrong number of results).
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 3b.) Fay's fix : supported multiple JOIN FETCH statements, but does not
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; support pagination (ie query.setMaxResults(), query.setFirstResult()
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; doesn't
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; page forward as expected).
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; So there is work being done, but it's turned out to be a very ticklish
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; issue
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; to solve.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; At the risk of muddying the waters a bit if you're migrating a JDO
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; application have you considered using OpenJPA's FetchPlan
&lt;br&gt;&amp;gt; implementation
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; eagerly load some fields? Over medium - large datasets I've found this
&lt;br&gt;&amp;gt; to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; be
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; significantly faster than using a JOIN FETCH, but YMMV.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Hope this helps,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; -mike
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; On Tue, Nov 17, 2009 at 8:48 AM, Daryl Stultz &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032548&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Nov 17, 2009 at 9:27 AM, Michael Simons
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032548&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; You state, that you're query with distinct and join fetch does work
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; properly. But this would
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mean OpenJPA-1365 doesn't occur, does it?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; The JIRA states:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; This issue occurs if the proposed fix for OPENJPA-894 is in place.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; So 1365 does not occur unless you've patched your code such that 894
&lt;br&gt;&amp;gt; is
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; fixed. What version of OpenJPA are you using and do you have any
&lt;br&gt;&amp;gt; patches
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; place?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; When we call &amp;quot;select a from A a join fetch B&amp;quot; we get n instances of
&lt;br&gt;&amp;gt; A,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; with
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; n = numbers of
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; A-B-associations.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; This is the correct behavior. I have found with OpenJPA 1.2.1, I get
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; distinct rows of A which sounds like what you (and I) want but is
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; improper.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; 894 shows that a second run of the query in the same EntityManager
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; yields
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; duplicates A's (with LEFT JOIN FETCH). What happens when you do this:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; select distinct a from A a join fetch a.bs
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; ?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; How about these two:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; select a from A a left join fetch a.bs
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; select distinct a from A a left join fetch a.bs
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; I don't want to give the impression that I'm an expert on the matter,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; just
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; that I've dealt with this issue and I want to be sure my understanding
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; of
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; things is accurate.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Daryl Stultz
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; _____________________________________
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; 6 Degrees Software and Consulting, Inc.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.6degrees.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.6degrees.com&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; mailto:&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=4032548&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;[hidden email]&lt;/a&gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/How-work-around-OpenJPA-1365-tp4017737p4032548.html" />
	<thr:in-reply-to ref="tag:n2.nabble.com,2006:post-4030956"/>
</entry>

</feed>
