Thanks!  I'd certainly rather it be something I'm doing wrong.  I
think you have represented my exact scenario there.

I'll continue looking at my code.

On Sep 21, 9:49 am, leszek <leszek.ptokar...@gmail.com> wrote:
> That's very interesting because it works for me:
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Employee {
>
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key id;
>
>     private String firstName;
>
>     private String lastName;
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class A (B) {
>
>     public Long getId() {
>                 return id;
>         }
>
>         public void setId(Long id) {
>                 this.id = id;
>         }
>
>         public Employee getE() {
>                 return e;
>         }
>
>         public void setE(Employee e) {
>                 this.e = e;
>         }
>
>         @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Long id;
>
> }
>
> ========================
> (regardless if transaction is used or not - simply makePersistent
> without transaction)
>
>                 PersistenceManager em = EMF.get().getPersistenceManager();
>                 Employee e = null;
>                 try {
>                         em.currentTransaction().begin();
>                 A a = new A();
>                 e = new Employee();
>                 a.setE(e);
>                 em.makePersistent(a);
>                 em.currentTransaction().commit();
>                 } catch (Exception ee) {
>                         em.currentTransaction().rollback();
>                 }
>
>                 try {
>                         em.currentTransaction().begin();
>                 B b = new B();
> //              e = new Employee();
>                 b.setE(e);
>                 em.makePersistent(b);
>                 em.currentTransaction().commit();
>                 } catch (Exception ee) {
>                         em.currentTransaction().rollback();
>                 }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to