Error during cascaded merge



I have a new problem with ObjectDB 2.5.5_02. This issue appeared after the upgrade from 2.5.5.

I get the following exception:

Caused by: com.objectdb.o._IllegalArgumentException: Specified object is not an entity object
at com.objectdb.o._IllegalArgumentException.b(
at com.objectdb.o.JPE.g(
at com.objectdb.o.ERR.f(
at com.objectdb.o.OBC.onObjectDBError(
at com.objectdb.jpa.EMImpl.merge(

To narrow the problem down I created this simple testcase which triggers the error:

public void testChannelConfigDirect() {
    Query query = em.createQuery("SELECT u FROM Unit u");
    List<Unit> result = query.getResultList();
    Unit unit = result.get(0);
    unit.getChannelConfigurationSets().add(new ChannelConfigurationSet());

This is exactly what happens in our webapp. A unit entity gets detached, the user edits it, its merged back.
Here are the relevant parts of the involved Entity classes:

    @Index(members = {"lastPosition.receiveTime"}),
    @Index(members = {"lastMovingPosition.receiveTime"}),})
public class Unit implements Serializable, Comparable<Unit> {

@OneToMany(mappedBy = "unit", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
    @OrderBy("configDate DESC")
    public List<ChannelConfigurationSet> getChannelConfigurationSets() {
        return channelConfigurationSets;

@Index(members = {"unit", "configDate"}, unique = "true")
public class ChannelConfigurationSet implements Serializable {

As I said before it all worked before the update to _02.



Merge errors are the result of fixing issue #222, which indicates correctly that an attempt to pass a non entity object to merge should throw an exception with a clear error message.

Unfortunately the fix in build 2.5.5_02 is broken. Please try build 2.5.5_03.

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


The new build works perfectly.

Post Reply

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