ObjectDB ObjectDB

Internal error

#1
SEVERE: Exception
[ObjectDB 2.7.1_01] Unexpected exception (Error 990)
  Generated by Java HotSpot(TM) 64-Bit Server VM 1.8.0_131 (on Linux 4.13.0-16-generic).
Please report this error on http://www.objectdb.com/database/issue/new
com.objectdb.o.InternalException: null
com.objectdb.o.InternalException
at com.objectdb.o.InternalException.f(InternalException.java:236)
at com.objectdb.o.STA.K(STA.java:348)
at com.objectdb.o.ENT.F(ENT.java:546)
at com.objectdb.o.ENT.O(ENT.java:694)
at com.objectdb.o.LDR.G(LDR.java:613)
at com.objectdb.o.LDR.F(LDR.java:473)
at com.objectdb.o.OBC.U2(OBC.java:1102)
at com.objectdb.o.QRR.f(QRR.java:222)
at com.objectdb.jdo.JdoQuery.execute0(JdoQuery.java:844)
at com.objectdb.jdo.JdoQuery.execute(JdoQuery.java:761)
edit
delete
#2

Thank you for this report. It seems to be related to an an attempt to retrieve an entity object that is part of the query results but cannot be found in the database.

Is it possible that the entity object was deleted from the database by a concurrent thread while the query was executed? Any other details regarding this unexpected situation may help.

ObjectDB Support
edit
delete
#3

I will try and provide more information and get back to you as soon as possible.

edit
delete
#4

The situation that caused this error was this:  In one thread I was opening an embedded database, and then that thread crashed because of an exception.  Then, another thread attempted to use the database.  Both threads were using the same PersistenceManagerFactory.

I hope this helps.

edit
delete
#5

Thanks. Is there a chance to get also the other stack trace (of the crashed thread)? It may help.

ObjectDB Support
edit
delete
#6

This is that stack trace:

at com.spiffymap.naviupdate.services.OSService.checkResult(OSService.java:20)
at com.spiffymap.naviupdate.services.OSService.loadMassStorageDriver(OSService.java:25)
at com.spiffymap.naviupdate.server.NaviupdaterServlet.setupExchangeSetMedium(NaviupdaterServlet.java:1166)
at com.spiffymap.naviupdate.server.NaviupdaterServlet.init(NaviupdaterServlet.java:1144)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1501)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1463)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.spiffymap.naviupdate.server.Runner.main(Runner.java:58)
edit
delete
#7

What I need is at least advice as to the best way to recover from this exception - close persistence and run the Doctor?  Ignore it and try again?  The product will be used in an IoT device.  It has to be able to run for months if not years without maintenance. I hope to be releasing a trial version of this product in a few weeks, at which point we will be wanting to buy the appropriate license from you . I need to be able to deal with this problem by then.

edit
delete
#8

Thanks for the stack trace at #6 above. It doesn't mention ObjectDB so it cannot help directly in understanding the problem, but are you sure that the exception at #1 is always related to an exception in another thread? How often does it happen? Do you have the ability to reproduce the exception?

You wrote that:

> In one thread I was opening an embedded database, and then that thread crashed because of an exception

What happened before and after the exception? Was the database opened before? closed after the exception was thrown?

The exception at #1 was thrown during an attempt to retrieve an object in a query result, which was not found in the database. i.e. it was in the database when the query was run but not later on an attempt to access it. This is a possible and normal situation that usually produces an error 631 "Entity is not found: ...". Did you get and expect such errors? In this specific case there was an unexpected state during preparation of that exception.

The best guess for a possible cause of this exception is sharing entity objects of one PersistenceManager by multiple threads and / or other PersistenceManager instances. You wrote:

> Both threads were using the same PersistenceManagerFactory.

But are objects separated in these threads, where each of them uses only objects from its own PersistenceManager?

There are several things that we can do to try to recover automatically from this exception, but before we proceed, it would help if we can understand better the context in which this exception is thrown.

ObjectDB Support
edit
delete
#9

>Thanks for the stack trace at #6 above. It doesn't mention ObjectDB so it cannot help directly in understanding the problem, but are you sure that the exception at #1 is always related to an exception in another thread? How often does it happen? Do you have the ability to reproduce the exception?

The other thread does not use ObjectDB at the point at which it crashes.  Since they, I have had internal errors which are not accompanied by another thread crashing.  This tend to happen when my program starts.  It's not easily repeatable.

You wrote that:

> In one thread I was opening an embedded database, and then that thread crashed because of an exception

>What happened before and after the exception? Was the database opened before? closed after the exception was thrown?

The database was opened, but was not closed after the exception.

The exception at #1 was thrown during an attempt to retrieve an object in a query result, which was not found in the database. i.e. it was in the database when the query was run but not later on an attempt to access it. This is a possible and normal situation that usually produces an error 631 "Entity is not found: ...". Did you get and expect such errors? In this specific case there was an unexpected state during preparation of that exception.

The best guess for a possible cause of this exception is sharing entity objects of one PersistenceManager by multiple threads and / or other PersistenceManager instances. You wrote:

> Both threads were using the same PersistenceManagerFactory.

>But are objects separated in these threads, where each of them uses only objects from its own PersistenceManager?

Yes.

There are several things that we can do to try to recover automatically from this exception, but before we proceed, it would help if we can understand better the context in which this exception is thrown.

edit
delete
#10

We can release a new build that instead of throwing the exception will write information to the log and proceed (ignoring that unexpected state).

It may or may not solve the issue. How often do you get that exception for getting feedback for that change?

ObjectDB Support
edit
delete
#11

I have been getting that exception several times a day, so I can give you feedback soon.  

edit
delete
#12

Please try build 2.7.2_07 and report new log messages that start with:

"Unexpected state in removeEntityTracker"

 

ObjectDB Support
edit
delete
#13

New version of objectdb installed.  Will report back log entries soon.

edit
delete
#14

I believe I may have found a possible cause of the internal error:  I have a complex project, and I discovered that two different versions of the objectdb.jar may have been used by different parts of the project.  Making sure that only one version - 2.7.2_07 - is used seems to have fixed the problem.

edit
delete
#15

Thank you for the update. If you can share the new log messages (if any), anyway, it may help.

Of course, please report if you still get the exception again after moving to one ObjectDB version.

ObjectDB Support
edit
delete
#16

If it would help, I can try and reproduce the error by mixing versions of objectdb again in my application.  However, as I have not had the exception since fixing the objectdb dependencies I am happy if this bug is closed.

edit
delete
#17

This issue will be closed, no need for further investigation now.

If you see the exception again please reopen it and report.

ObjectDB Support
edit
delete
#18

Apparently this was a regression caused by fixing issue #2027. Build 2.7.6_08 should fix it.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.