Sorry, I am wrong.
I inspected my source code and found the real cause.

The following code can works on SDK1.3.0, but it throws
"java.lang.IllegalArgumentException:
 can't operate on multiple entity groups in a single transaction."
when it used on SDK1.3.1.

----
PersistenceManager pm = pmfInstance.getPersistenceManager();

pm.makePersistent(new EntityB("key"));  // If this two lines are
commented out,
pm.getObjectById(EntityB.class, "key"); // the following code throws
exception on SDK1.3.0 too.

ArrayList<EntityA> entities = new ArrayList<EntityA>(2);
entities.add(new EntityA());
entities.add(new EntityA());
Transaction tx = pm.currentTransaction();
tx.begin();
pm.makePersistentAll(entities); // it throws exception if it compiled
using sdk1.3.1.
tx.commit();
----

Full source code is here.
https://test-gae-j-sdk-131.googlecode.com/hg/

On 2月12日, 午前3:11, "Max Ross (Google)" <maxr+appeng...@google.com>
wrote:
> Assuming a ClassA object with the specified id already exists, the code
> you've posted works fine for me.  Could you put together a complete example
> that demonstrates the unexpected behavior?
>
> Thanks,
> Max
>
>
>
> On Wed, Feb 10, 2010 at 7:49 PM, vori <vori...@gmail.com> wrote:
> > Is it a bug on JDO of SDK 1.3.1?
>
> > ------
> > PersistentManager pm = PMF.get().getPersistenceManager();;
>
> > ClassA classA = pm.getObjectById(ClassA.class, "id");
> > ClassB classB = new ClassB();
>
> > Transaction tx = pm.currentTransaction();
> > tx.begin();
> > pm.makePersistent(classB);
>
> > tx.commit(); // It throws "javax.jdo.JDOException: can't operate on
> > multiple entity groups in a single transaction."
> > ------
>
> > --
> > 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-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2B 
> > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
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-j...@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