NPE after an @embedded obj is updated for a detached entity

#1

I have an entity that looks like this:

class User {
    @embedded private Profile profile;
    ...
}

After running something like this:

    User user = entityManager.createQuery("select......
    entityManager.detach(user);
    user.getProfile().setDescription("Something...

I get the following error:

 [ObjectDB 2.0.3_02] Unexpected exception (Error 990)
 Generated by Java HotSpot(TM) Client VM 1.6.0_21 (on Windows 7 6.1).
 Please report this error to ObjectDB support (support@objectdb.com).
 com.objectdb.o.InternalException: java.lang.NullPointerException: null
 java.lang.NullPointerException
 at com.objectdb.o.ENT.W(ENT.java:975)
 at com.objectdb.o.ENT.beforeModifyEmbedded(ENT.java:954)
 at com.objectdb.o.EMT.beforeModifyMember(EMT.java:90)
 at com.test.user.UserProfile.__odbSet_description(UserProfile.java:1)
 at com.test.user.UserProfile.setDescription(UserProfile.java:12)
 at com.test.user.PersistUserTest.updateDetachedUser(PersistUserTest.java:102)

Did I miss some configuration or is this a bug?

#2

It is a bug. Thank you for your report.

Please try build 2.0.3_04 that should fix it.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login