Have you tried running the dao code in a transaction? Is your store and find happening in different transactions? Also you should take a note of "Unlike with most databases, queries and gets inside a datastore transaction do not see the results of previous writes inside that transaction. Specifically, if an entity is modified or deleted within a transaction, a query or get will return the original version of the entity as of the beginning of the transaction, or nothing if the entity did not exist then." from the docs http://code.google.com/appengine/docs/java/datastore/transactions.html
btw, for unit testing with the local datastore we have information on our blog here http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-application-on-gae/ Regards | Vikas On Sep 28, 4:35 am, "David C. Hicks" <[email protected]> wrote: > I have followed the instructions I found and set up the > LocalServiceTestHelper to act as a datastore. I can save an entity in > the datastore and re-read it, but then I make a call to search for all > entities that match a criteria. The resulting List<entity> collection > throws an "Object Manager has been closed" exception as soon as I try to > get the size(). > > I understand that this is resolved in a real runtime environment by > using the OpenEntityManagerInView filter, but in a testing environment > the filter isn't in play. I've been trying most of the day to figure > out how to keep the object manager open through the life of a test, but > damned if I can get it. Anyone know of a good example somewhere? > > Thanks, > Dave -- 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.
