If i want to execute this source code without errors, I have to delete the
first pm.close(); Anyone knows why?


          final Date date = new Date();
EmployeeData employee = new  EmployeeData("John", "Doe", date);

          PersistenceManager pm = PMF.get().getPersistenceManager();

          final Long id = pm.makePersistent(employee).getId();

          // From a different persistence manager, look up the // object

          employee = pm.getObjectById(EmployeeData.class, id);
          assertEquals(employee.getFirstName(), "John");
          assertEquals(employee.getLastName(), "Doe");

          pm.close();

         pm = PMF.get().getPersistenceManager(); */


          EmployeeData employee2 = new EmployeeData("John2", "Doe2", date);

          final Long id2 = pm.makePersistent(employee2).getId();

          // From a different persistence manager, look up the // object

          employee2 = pm.getObjectById(EmployeeData.class, id2);
          assertEquals(employee2.getFirstName(), "John");
          assertEquals(employee2.getLastName(), "Doe");

          pm.close();

Thanks.

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to