Author: pete.muir(a)jboss.org
Date: 2008-05-21 09:36:05 -0400 (Wed, 21 May 2008)
New Revision: 8254
Modified:
trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
EntityManager can be passed in as null
Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-05-21 12:49:45
UTC (rev 8253)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-05-21 13:36:05
UTC (rev 8254)
@@ -176,11 +176,11 @@
private AbstractPersistenceProvider getPersistenceProvider(EntityManager
entityManager)
{
// Work around EJBTHREE-912 (don't you just love random NPEs!)
- if (isInstanceOf(entityManager.getClass(),
"org.jboss.ejb3.entity.HibernateSession"))
+ if (entityManager != null && isInstanceOf(entityManager.getClass(),
"org.jboss.ejb3.entity.HibernateSession"))
{
return HibernatePersistenceProvider.instance();
}
- else if(isInstanceOf(entityManager.getDelegate().getClass(),
"org.hibernate.Session"))
+ else if(entityManager != null &&
isInstanceOf(entityManager.getDelegate().getClass(), "org.hibernate.Session"))
{
return HibernatePersistenceProvider.instance();
}
Show replies by date