Closed GoogleCodeExporter closed 9 years ago
Issue 231 has been merged into this issue.
Original comment by googleco...@yahoo.co.uk
on 15 Jul 2011 at 3:27
From the linked issue
// this *should* work, but doesn't
pm1 = pmf.getPersistenceManager();
pm1.currentTransaction().begin();
Person p1 = pm1.getObjectById(Person.class, 1);
pm2 = pmf.getPersistenceManager(); // a second PM
Person p2 = pm2.getObjectById(Person.class, 2); // throws exception
This should translate into
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Transaction txn = ds.beginTransaction();
Entity e1 = ds.get(personKey1);
DatastoreService ds2 = DatastoreServiceFactory.getDatastoreService();
Entity e2 = ds2.get(personKey2);
but doesn't. The "ds2" is just "ds" since DatastorePersistenceHandler is lazy,
and just uses the same DatastoreService for the majority reads/writes
regardless of the PersistenceManager that they belong to.
Original comment by googleco...@yahoo.co.uk
on 9 Aug 2011 at 6:38
I think the underlying issue is that datastore transactions are associated with
the thread that started them and independent of any particular
DatastoreService. Probably no easy fix here.
Original comment by max.r...@gmail.com
on 11 Aug 2011 at 3:27
The original test is not matching the title of the issue. i.e the second fetch
is not in a transaction. Consequently it falls into this GAE datastore
transaction black hole.
Solution : perform the second fetch in a transaction ... a real explicit
transaction. This works with SVN trunk when you do
Original comment by googleco...@yahoo.co.uk
on 12 Aug 2011 at 6:44
Original issue reported on code.google.com by
max.r...@gmail.com
on 15 Dec 2009 at 5:50