145 words

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

#1
2011-01-05 08:13

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?

gorilla77
gorilla77's picture
Joined on 2010-12-24
User Post #3
#2
2011-01-05 13:19

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)
support
support's picture
Joined on 2010-05-03
User Post #101

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel