> I see that JDOEntityTransaction is not defined,
The JDO Transaction is already a strict superset of EntityTransaction. To provide for a future EntityTransaction that includes more methods than are available in JDO Transaction, we could create a JDOEntityTransaction. But we could as easily add the new method directly to JDO Transaction.
> but the following should be good enough:
I'm not clear which case this is. If you need to setOptimistic, you need either a PersistenceManager or a JDOEntityManager from which to get the currentTransaction. If all you have is an EntityManager (that doesn't implement PersistenceManager or JDOEntityManager), you can't cast it. If you have a JDOEntityManager, you don't need to cast it.
>Do we need a method like em.getDelegate() but in the other direction, to get an EntityManager from a PersistenceManager proxy?
I've changed the return type of JDOEntityManagerFactory.getPersistenceManagerProxy to return JDOEntityManager. Is this enough?