Transaction tx = pm.currentTransaction();
tx.begin();
Extent extent = pm.getExtent(Actor.class, true);
Iterator iter = extent.iterator();
while( iter.hasNext() ){
Actor actor = (Actor) iter.next();
System.out.println(actor.getName());
}
extent.close(iter);
tx.commit();