Just going to take a wild shot that your problem is due to the following property...
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/> Any reason why you want to use this subclassing support? We removed it as the fallback enhancement process for a reason -- it really is not ready for production use. I would suggest the use of build-time or dynamic enhancment [1] over the use of subclassing. The functionality and performance of the enhancement process is far superior to the subclassing support. Good luck, Kevin [1] http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html On Sat, Dec 4, 2010 at 9:04 AM, Joel Halbert <[email protected]> wrote: > Hi Mike, > > Yes, you're right about the detatched state, it only happens when merging > in detatched entities. > > These are the properties I have set, nothing exotic. > > <properties> > <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/> > <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/> > <property name="openjpa.ConnectionDriverName" > value="org.apache.commons.dbcp.BasicDataSource"/> > <property name="openjpa.ConnectionProperties" > value="DriverClassName=com.mysql.jdbc.Driver,Url=jdbc:mysql://localhost:3306/myapp,Username=someuser,Password=topsecret"/> > > <property name="openjpa.DataCache" value="false"/> > <property name="openjpa.RemoteCommitProvider" value="sjvm"/> > </properties> > > > I'll take a look at the unit tests to see if can replicate it by running > them. > -joel > > > On 02/12/10 16:42, Michael Dick wrote: > >> I noticed your email, but didn't get a chance to look into the problem in >> any depth. I think there are unit tests that cover this scenario (at least >> with the default options). If you have any properties set in >> persistence.xml, could you post them? The JIRA suggests that the problem >> is >> related to detached state - which might help to narrow down the problem. >> >> Regards, >> -mike >> >> On Thu, Dec 2, 2010 at 8:06 AM, Joel Halbert<[email protected]> >> wrote: >> >> Hi, >>> Anyone able to comment on the below? I should mention I'm using 2.0.1 >>> Cheers >>> >>> J >>> >>> On 26/11/10 12:03, Joel Halbert wrote: >>> >>> Hi Folks, >>>> >>>> I'm getting the following response when trying to merge in an existing >>>> entity: >>>> >>>> <openjpa-2.0.1-r422266:989424 nonfatal user error> >>>> org.apache.openjpa.persistence.InvalidStateException: The generated >>>> value >>>> processing detected an existing value assigned to this field: com.su3ana >>>> lytics.crawler.model.GlobalFrontier.id. This existing value was either >>>> provided via an initializer or by calling the setter method. You either >>>> need to remove the @GeneratedValue annotation or mod >>>> ify the code to remove the initializer processing. >>>> at >>>> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:483) >>>> >>>> I can confirm that the id field is not set, either via a constructor, or >>>> by a setter method. >>>> >>>> Is it possible that it might be related to the followig issue in JIRA? >>>> >>>> >>>> https://issues.apache.org/jira/browse/OPENJPA-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619733 >>>> < >>>> >>>> https://issues.apache.org/jira/browse/OPENJPA-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619733 >>>> > >>>> >>>> >>>> If so, is there a fix/patch available? >>>> >>>> Cheers, >>>> Joel >>>> >>>> >>>> >
