diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java index b7b98687e..cb853d426 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java @@ -392,6 +392,10 @@ public class JDBCStoreManager for (Iterator itr = ((Collection) coll).iterator(); itr.hasNext();) { PersistenceCapable pc = (PersistenceCapable) itr.next(); + + if (pc == null) + continue; + OpenJPAStateManager sm = (OpenJPAStateManager) pc. pcGetStateManager(); FieldMapping[] fmd = ((ClassMapping) sm.getMetaData()). diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java index c0c457d4d..2b32fff48 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java @@ -32,7 +32,8 @@ public class TestChainEntities extends SingleEMFTestCase { long aid; public void setUp () { - setUp (ChainEntityA.class, ChainEntityB.class, ChainEntityC.class); + setUp (DROP_TABLES, + ChainEntityA.class, ChainEntityB.class, ChainEntityC.class); // Create A ChainEntityA a = new ChainEntityA (); a.setName ("TEST_A");