Ok, I figured out *what* my problem is, though I'm not certain *why*
it's happening.

First, I realized that my persistence.xml file did not have anything
set for the property "datanucleus.appengine.autoCreateDatastoreTxns".
I guess this defaults to true, because when I added the following to
persistence.xml:

        <property name="datanucleus.appengine.autoCreateDatastoreTxns"
value="false" />

I no longer received the exception above (I'm not running my query in
a transaction, so this sort of explains the "transaction error" seen
above and why disabling transactions would make that error go away).

That said, the child entity that I'm trying to get keys for has a Date
property.  When I remove the Date property from the entity entirely
(just for kicks) and re-run my test, I don't get the transaction
exception when I query (regardless of what I set
"datanucleus.appengine.autoCreateDatastoreTxns" to).

So, given that this is a simple keys-only query scenario (i.e., no
entity manipulation or updating is going on), why is the DataNucleus/
JPA code trying to make some updates to entity Date fields (thus
triggering a transaction exception)?

Thoughts?

On Oct 30, 2:48 pm, David Fuelling <[email protected]> wrote:
> Bump.
>
> I'm running into this same exact problem -- I have the same type of
> entity setup, and am do a "key-only" query on a non-root object.  Also
> getting the same exact "Illegal argument" error.  I get the error
> whether I'm running in a transaction or not (which is strange -- I
> have my "<property name="datanucleus.NontransactionalRead"
> value="true" />" in my persistence.xml settings which should allow non-
> transactional reads).
>
> Thoughts?
>
> On Oct 9, 3:52 pm, gwright <[email protected]> wrote:
>
> > I am trying to perform a query to return a list of Order ids using JPA
>
> > "SELECT id FROM Order WHERE date = :date"
>
> > However Order is a child object of a User object so I can do some
> > transactional stuff between order and user.  This seems to cause a
> > problem with the query as I am getting the following exception -
>
> > 2009-10-09 15:00:33.358::WARN:  Nested in
> > org.springframework.orm.jpa.JpaSystemException: Illegal argument;
> > nested exception is javax.persistence.PersistenceException: Illegal
> > argument:
> > java.lang.IllegalArgumentException: can't operate on multiple entity
> > groups in a single transaction. found both Element {
> >   type: "User"
> >   id: 39}
>
> >  and Element {
> >   type: "User"
> >   id: 30
>
> > }
>
> > As I am only loading the Order object id I was hoping this would work
> > - is this wrong or I missing something.
>
> > regards
> > Graham
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to