NIchole,
Thank you for your feedback, but how do I change my code so that I have
this entity group you are mentioning? I am using the HR datastore. And
how did you get to this conclusion?
I am fetching every store from the datastore, detaching everything after
making it persistent, and always touching fields before accessing them,
so why are things not working out?
@PersistenceCapable(detachable="true")
class ZZZStore {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private AdminUser admin;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="email asc"))
private List<RegularUser> users;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="itemCode asc"))
private List<Item> inventory;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="receiveDate asc, receiptID asc"))
private List<Receipt> receipts;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="saleID asc"))
private List<Sale> sales;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="shipDate asc"))
private List<Shipment> shipments;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
//@Order(extensions = @Extension(vendorName="datanucleus",
key="list-ordering", value="cusID asc"))
private List<Customer> customers;
//@Persistent(defaultFetchGroup = "true")
@Persistent
@Element(dependent = "true")
private Company company;
}
@PersistenceCapable
class Sale {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private long saleID;
@Persistent
private Date saleDate;
@Persistent
private String cusID;
@Persistent
private String repID;
@Persistent
//@Persistent(defaultFetchGroup = "true")
private List<SaleItem> saleItems;
}
static void persistStore() {
PersistenceManager pm = PMF.get().getPersistenceManager();
Transaction tx = pm.currentTransaction();
try {
tx.begin();
pm.makePersistent(Data.store);
tx.commit();
} finally {
if (tx.isActive())
tx.rollback();
pm.close();
}
}
On Thu, Feb 2, 2012 at 11:01 AM, Nichole <[email protected]> wrote:
> you need an entity group
>
> http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html
>
> or cross group transactions if you are using the HR datastore:
> http://code.google.com/appengine/docs/python/datastore/transactions.html
>
> or If you are not on the HR datastore and need 2-phase locking
> transactions:
>
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/497060c343e16052/18f8603e9ffe3db4?lnk=gst&q=Good+point+++nichole#18f8603e9ffe3db4
>
>
> On Feb 1, 10:25 am, John Goche <[email protected]> wrote:
>> Hi,
>>
>> I've raised the issue with a test case in google's issue tracker:
>>
>> http://code.google.com/p/datanucleus-appengine/issues/detail?id=259
>>
>> I am hoping someone can kindly have a look at it and get back to me
>>
>> as I cannot see how I can make use of JDO on app engine without this fixed.
>>
>> In the meantime any suggestions on how to work around the problem would
>>
>> be greatly appreciated.
>>
>> Kind Regards,
>>
>> John Goche
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Feb 1, 2012 at 9:21 AM, datanucleus <[email protected]> wrote:
>> > So it can't find a related Entity. You could obviously use the DB
>> > viewer (or a low level API call) to check whether it is present (with
>> > that Key), and look in the log for whether it was PUT.
>>
>> > Can't speak for Google but I'm sure nobody has interest in private
>> > code, though I'm sure that it ought to be perfectly simple to generate
>> > a testcase something akin to the format used by DataNucleus
>> >http://www.datanucleus.org/project/problem_jdo_testcase.html
>> > if the issue is as clear as you say in terms of reproducing it. And
>> > then you can raise an issue in Googles issue tracker with the
>> > testcase; obviously without the testcase then nobody, other than you,
>> > can see it.
>>
>> > --
>> > 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
>> > athttp://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.
>
--
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.