tzaeschke / zoodb

ZooDB Object Database
Apache License 2.0
57 stars 9 forks source link

NPE in serializer #57

Closed tzaeschke closed 9 years ago

tzaeschke commented 9 years ago

If a transaction has only new objects (no modified objects) and if the new objects have other persistent capable objects referenced (but no have called makePersistent() on them) and if we are not in the first transaction in a session, then we get the following NPE:

java.lang.NullPointerException
    at org.zoodb.api.impl.ZooPC.jdoZooGetClassDef(ZooPC.java:286)
    at org.zoodb.internal.DataSerializer.writeClassInfo(DataSerializer.java:601)
    at org.zoodb.internal.DataSerializer.serializeObjectNoSCO(DataSerializer.java:324)
    at org.zoodb.internal.DataSerializer.serializeFields1(DataSerializer.java:198)
    at org.zoodb.internal.DataSerializer.writeObject(DataSerializer.java:174)
    at org.zoodb.internal.model1p.DataSink1P.write(DataSink1P.java:108)
    at org.zoodb.internal.Session.commitInternal(Session.java:312)
    at org.zoodb.internal.Session.commit(Session.java:150)
    at org.zoodb.jdo.impl.TransactionImpl.commit(TransactionImpl.java:85)

See also Test_083_SerailizationBugs.testSerialization().