ObjectDB ObjectDB

Exception after update of indices of Entity class

#1

Hello,

I changed the index definition of an entity class from @Index()... to @Indices() and now I get the following stacktrace upon start:

Exception in thread "ODB-IndexActivation" java.lang.ClassCastException: com.objectdb.o.PIX cannot be cast to com.objectdb.o.FIX
at com.objectdb.o.EIX.<init>(EIX.java:70)
at com.objectdb.o.IXM.L(IXM.java:721)
at com.objectdb.o.IXM.M(IXM.java:697)
at com.objectdb.o.IXM.L(IXM.java:659)
at com.objectdb.o.IXM.K(IXM.java:602)
at com.objectdb.o.IXM.J(IXM.java:572)
at com.objectdb.o.IIS.j(IIS.java:67)
at com.objectdb.o.IXS.i(IXS.java:92)
at com.objectdb.o.IIS.p(IIS.java:55)
at com.objectdb.o.IXM.Vz(IXM.java:453)
at com.objectdb.o.PBI.C(PBI.java:146)
at com.objectdb.o.PBI.q(PBI.java:115)
at com.objectdb.o.MBI.VC(MBI.java:83)
at com.objectdb.o.MST.U8(MST.java:783)
at com.objectdb.o.IXM.E(IXM.java:378)
at com.objectdb.o.IXM.run(IXM.java:350)
at java.lang.Thread.run(Thread.java:748)

Is there any way to fix this?

Best regards,
Markus Ritter

edit
delete
#2

Which ObjectDB version are you using? According to the stack trace it is not the most recent build. Could you please try opening the database after the index change with the most recent ObjectDB build and then post a stack trace again?

ObjectDB Support
edit
delete
#3

Hello,

with the latest 2.7.1_02 I get the following stacktrace:

Exception in thread "ODB-IndexActivation" java.lang.ClassCastException: com.objectdb.o.PIX cannot be cast to com.objectdb.o.FIX
at com.objectdb.o.EIX.<init>(EIX.java:70)
at com.objectdb.o.IXM.L(IXM.java:722)
at com.objectdb.o.IXM.M(IXM.java:698)
at com.objectdb.o.IXM.L(IXM.java:660)
at com.objectdb.o.IXM.K(IXM.java:603)
at com.objectdb.o.IXM.J(IXM.java:573)
at com.objectdb.o.IIS.j(IIS.java:67)
at com.objectdb.o.IXS.i(IXS.java:92)
at com.objectdb.o.IIS.p(IIS.java:55)
at com.objectdb.o.IXM.Vz(IXM.java:454)
at com.objectdb.o.PBI.C(PBI.java:146)
at com.objectdb.o.PBI.q(PBI.java:115)
at com.objectdb.o.MBI.VC(MBI.java:83)
at com.objectdb.o.MST.U8(MST.java:783)
at com.objectdb.o.IXM.E(IXM.java:379)
at com.objectdb.o.IXM.run(IXM.java:351)
at java.lang.Thread.run(Thread.java:748)

Best regards

edit
delete
#4

Thanks. Changing from @Index()... to @Indices() should not change anything if it is only annotation change with no real index definition change. Could you describe the index change itself?

The stack trace may indicate an issue with an embedded class with no indexes or fields (which maybe had indexes before). Have you changed the indexes of an embedded class?

ObjectDB Support
edit
delete
#5

Hello,

here are my classes:


@Indices ({
    @Index (members = {"recurrence.recurringEvent"}),
    @Index (members = {"relations.related"})
})
public class Event extends Entity
{
    @Embedded
    private Recurrence recurrence = null;
    @ElementCollection
    private Collection<Relation> relations = new LinkedHashSet<>();
    ...
}


@Embeddable
public class Recurrence
{
    private String recurringEventId = null;
    private Event recurringEvent = null;
    ...
}

@Embeddable
public abstract class Relation
{
    private String relatedId = null;
    private Event related = null;
     ...
}

I changed the Indices from

@Index("recurrence.recurringEvent") to

@Indices{@Index("recurrence.recurringEventId"),@Index("relations.relatedId")}

Than it crashes. Now I use 

@Indices{@Index("recurrence.recurringEvent"),@Index("relations.related")}

and it works.

Best regards

edit
delete
#6

OK. We cannot reproduce it, but please report again if it reoccurs.

ObjectDB Support
edit
delete
#7

Hello,

I got the error again. As stated above I changed the indices from single index to multiple indices. Running the database doctor will then remove all events from their calendars.

Best regards
Markus

edit
delete
#8

Did it happen again with the same index change, but now on a different database file? or a new index change on the same database file? Any other details may help. Do you have a way to reproduce it (even on your computer)?

ObjectDB Support
edit
delete
#9

Build 2.7.1_03 includes an attempt to fix this exception. Could you please try it?

ObjectDB Support
edit
delete
#10

Hello,

unfortunately this did not fix my issue. I opened a new ticket at http://www.objectdb.com/database/support/636. There is also our database file attached.

Best regards

edit
delete

Reply

To post on this website please sign in.