[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-02-05 Thread datanucleus
 A little more info on my example too.

I'll refer you to my previous comment then.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-02-05 Thread Rogue Wind


On Feb 5, 3:14 am, datanucleus andy_jeffer...@yahoo.com wrote:
  A little more info on my example too.

 I'll refer you to my previous comment then.

I've looked at your test example and am following the exact same
pattern. You have me and somebody else here getting the exact same
error. Something isn't working with this in a real GAE implementation
outside of a test harness. Has anybody else been able to get this
bidirectional m-n unowned relationship to work in a REAL environment?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-02-05 Thread Rogue Wind

Ahhh...I had my side a and side b mixed up. My mappedBy attribute was
on the wrong side causing the issue. :) It now works...thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-02-04 Thread Rogue Wind
I'm getting the exact same error. I have the most recent version. The 2.0 
final version. My sequence is to instantiate side b, instantiate side a, 
add b to a's list, then add a to b's list. I then attempt to persist side a 
and I get the exception Detected attempt to establish This(2) as the 
parent of That(1) but the entity identified by That(1) has already been 
persisted without a parent.  A parent cannot be established or changed once 
an object has been persisted.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/NSKQTmRc9YoJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-02-04 Thread Rogue Wind
A little more info on my example too. This is an M-N relationship and I am 
attempting to do a bidirectional unowned relationship not in the same 
entity group. What I am noticing is that when persisting side a, I do see 
side b created, and I see the reference to side b added to the list of side 
a and I see side b without a's reference in the datastore viewer. The error 
seems to be when it is attempting to store side a's reference in side b's 
list. Is the fact that these are in different transactions affecting this 
behavior?

I've double checked all the obvious problems. Both side a and b have each 
other's reference marked as @Unowned. Side b has the mappedBy set to side 
a's name. Unidirectional doesn't have any issues in my example. 

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/W6BwIgnu9_0J.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-01-26 Thread datanucleus
Who can say; you need to define what you're doing. So look at

http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/com/google/appengine/datanucleus/jpa/JPAManyToManyTest.java

and write a test, using that same sample, with the operations you're
performing.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-01-25 Thread Marrrck
Thanks datanucleus!

I thought about the @Unowned annotation but I didn't have the
datanucleus-appengine-2.0.0-RC2.jar in my eclipse build path...

Unfortunately I'm not out of the woods yet. I downloaded and built the
jars from the the svn trunk, and I modified my entities to match
exactly the mapping defined in the JPAManyToManyTest.java from the
unit tests in that project, but when I run my application locally via
eclipse, I get this exception:

Caused by: com.google.appengine.datanucleus.EntityUtils
$ChildWithoutParentException: Detected attempt to establish This(2) as
the parent of That(3) but the entity identified by That(3) has already
been persisted without a parent.  A parent cannot be established or
changed once an object has been persisted.
at
com.google.appengine.datanucleus.EntityUtils.checkParentage(EntityUtils.java:
577)
at
com.google.appengine.datanucleus.scostore.FKSetStore.add(FKSetStore.java:
171)
at org.datanucleus.store.types.sco.backed.Set.add(Set.java:562)


Seems like at runtime the @Unowned is being ignored? Not sure if this
is a classpath issue or maybe something to do with running it locally
in Eclipse using the GAE plugin? I'm not really sure what else to look
for at this point so if you have any ideas for anything else I can
check I'd really appreciate it.


THanks again for the response...

On Jan 22, 11:11 am, datanucleus andy_jeffer...@yahoo.com wrote:
 To make a relation unowned (in v2) you mark (both sides if
 bidirectional) as @Unowned
 Unowned M-N work fine with SVN trunk code, though there may have been
 some things incomplete in RC versions

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-01-22 Thread Paul Bartosik
Marc,

The Google App Engine documentation for JPA says that ManyToMany and 
unowned relationships are not supported.
http://code.google.com/appengine/docs/java/datastore/jpa/overview.html 

Even so, why are you using the url String as your @Id for the second table? 
 Why not another Key?

-Paul


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/OrGN2tw17b0J.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unowned relations JPA examples for datanucleus plugin v2

2012-01-22 Thread datanucleus
To make a relation unowned (in v2) you mark (both sides if
bidirectional) as @Unowned
Unowned M-N work fine with SVN trunk code, though there may have been
some things incomplete in RC versions

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.