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)" <[email protected]>
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 <[email protected]> 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
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine-java%2B
> > [email protected]>
> > .
> > 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.