Unexpected exception during open the database

#1

Hello,

do have an idea why we get following exception sometimes, if we open a database?

Exception 1:

Exception in thread "Thread-18" java.lang.NullPointerException
at com.objectdb.o.LFL.YC(LFL.java:987)
at com.objectdb.o.LFL.YC(LFL.java:962)
at com.objectdb.o.PCF.g(PCF.java:149)
at com.objectdb.o.PAG.N(PAG.java:494)
at com.objectdb.o.UPT.a(UPT.java:180)
at com.objectdb.o.URT.a(URT.java:183)
at com.objectdb.o.TSK.f(TSK.java:184)
at com.objectdb.o.TSK.b(TSK.java:157)
at com.objectdb.o.TSK.c(TSK.java:96)
at com.objectdb.o.TSM.a(TSM.java:88)
at com.objectdb.o.UTT.r(UTT.java:377)
at com.objectdb.o.UTT.g(UTT.java:205)
at com.objectdb.o.TSK.b(TSK.java:146)
at com.objectdb.o.TSK.c(TSK.java:96)
at com.objectdb.o.MST.Zc(MST.java:1180)
at com.objectdb.o.IXA$1.run(IXA.java:418)

 

Exception 2:

Exception in thread "ODB-IndexActivation" java.lang.NullPointerException
at com.objectdb.o.LFL.Yz(LFL.java:1154)
at com.objectdb.o.LFL.Yz(LFL.java:1127)
at com.objectdb.o.PAG.Q(PAG.java:953)
at com.objectdb.o.PGC.p(PGC.java:285)
at com.objectdb.o.SNP.v(SNP.java:459)
at com.objectdb.o.OBI.f(OBI.java:453)
at com.objectdb.o.OBI.e(OBI.java:362)
at com.objectdb.o.OBI.d(OBI.java:279)
at com.objectdb.o.MBI.a(MBI.java:53)
at com.objectdb.o.MBI.Zi(MBI.java:73)
at com.objectdb.o.MST.ZY(MST.java:811)
at com.objectdb.o.IXA.a(IXA.java:294)
at com.objectdb.o.IXA.run(IXA.java:266)
at java.lang.Thread.run(Thread.java:748)
#2

This report seems to be related to Issue #1860, which is still open, but apparently there is a workaround.

See posts #11 and #13 by your company.

The problem seems to be related to opening and closing the database for a short period, when indexes require updates.

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

The issue is not related to Issue #1860.

It occurs, if an implict migration of package name and class name of an entity is defined in the objectdb.conf.

    <schema>
        <package name="com.btc.ep.bl.dmos">
            <class name="TestImpl" new-name="com.btc.ep.bl.internal.dmos.RenamedTestImpl"/>
        </package>                    
    </schema>

@Entity
public class RenamedTestImpl {

    ...

    @Index
    private String scopeID;

    ...

}

if we remove the @Index annotation in the entity or we remove the schema block from objectdb.conf all works fine during opening the database.

The automatic index update is not part of the objectdb.conf, this cannot be the reason.
<!--<index-update enabled="true" priority="40" />-->

 

#4

The exception is thrown during index rebuild. It is strange that a schema change triggers an index update, unless the target class already exists with objects, and without the index.

Anyway, it seems that during index rebuild the database is closed, which is a known issue with the index rebuild. Could you please check if you get the exception, if you open the database and keep it open longer?

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

The issue also occurs, if we wait 10 minutes before we close the database.

We have also the code part, mentioned in Issue #1860, in order to synchronize the ODB-IndexActivation Thread.

 

#6

> The issue also occurs, if we wait 10 minutes before we close the database.

Could please clarify if in this case the exception is also thrown after 10 minutes, immediately after closing the database?

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

The exception is thrown after closing the database.

#8

I have still a question about the automatic index thread.

If the automatic index thread fails with an exception then I would expect that the index is automatically rebuild, if the database is opened again for a longer time. Is that the case?

#9

> The exception is thrown after closing the database.

We will look into a way to silence this exception.

> If the automatic index thread fails with an exception then I would expect that the index is automatically rebuild, if the database is opened again for a longer time. Is that the case?

Yes.

It is still unclear why an index rebuild is required due to class name change. Are you sure that this is the only schema change?

 

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

Yes, the reason is the schema change for an entity which have a field with @Index.

If we remove the @Index from the entity or we remove the schema change from objectdb.conf then all works fine.

#11

Thank you for this clarification. Some more information may help.

Are these exceptions written to the log? thrown? stop anything?

We can provide a quick fix that catches and hides the exception by simply exiting the index update thread in that case, but it is important to understand if there are any side effects except getting these exception in the log.

You wrote:

> do have an idea why we get following exception sometimes, if we open a database?

But the stack traces do not show opening a database. Maybe you have other stack traces that show the caller methods that try to open the database?

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

Post Reply

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