Are we looking at different classes? I can't find the code in javax.persistence.Persistence under GlassFish that looks up persistence units. It's all delegated to the providers.

thanks,
-marina

Patrick Linskey wrote:
If a provider does not qualify as the provider for the named persistence unit, it must return null when createEntityManagerFactory is invoked on it.


That's what the provider must do when
PersistenceProvider.createEntityManagerFactory() is called, not what the
Persistence class must do.

As you can see in the code, Persistence already throws exceptions if it
can't find any persistence units. It could just be a bit more
informative about why.
-Patrick


Reply via email to