Issue #827: [ObjectDB 2.4.1] Unexpected exception (Error 990) on getObjectById

Type: Bug ReoprtVersion: 2.4.1Priority: NormalStatus: ClosedReplies: 3
#1

In this code:

String id = "my key";
ABC itemDb = pm.getObjectById(ABC.class, id);

I get this:

[ObjectDB 2.4.1] Unexpected exception (Error 990)
  Generated by Java HotSpot(TM) Client VM 1.6.0_29 (on Windows 7 6.1).
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.y(ENT.java:493)
at com.objectdb.o.ENT.H(ENT.java:641)
at com.objectdb.o.LDR.w(LDR.java:411)
at com.objectdb.o.LDR.v(LDR.java:293)
at com.objectdb.o.LDR.s(LDR.java:211)
at com.objectdb.o.OBC.aN(OBC.java:1075)
at com.objectdb.o.OBC.aL(OBC.java:988)
at com.objectdb.o.OBC.aF(OBC.java:716)
at com.objectdb.jdo.PMImpl.getObjectById(PMImpl.java:410)

...

Ideas welcome.

#2

The stack trace indicates an internal ObjectDB bug (unexpected state).

If you can post a test case that causes this exception it would be very helpful. 

ObjectDB Support
#3

Unfortunately I was trying to retrofit ObjectDB into an existing rather complex app, rather than start from scratch, so it isn't feasible to extract a test case in the time I have available.

For information, the problem exhibited itself in a scenario when all the database records had been deleted in a successful transaction immediately prior to executing the get which errored.

#4

It is unclear what you are trying to retrieve just after deleting all the objects from the database.

The following test program tries to reproduce it but with no success:

import javax.jdo.*;
import javax.jdo.annotations.*;

public class T827 {

    public static void main(String[] args) {
       
        PersistenceManagerFactory pmf =
            JDOHelper.getPersistenceManagerFactory("objectdb:d:\\temp\\test.tmp;drop");
        PersistenceManager pm = pmf.getPersistenceManager();
       
        try {
            Object oid = null;
            pm.currentTransaction().begin();
            for (int i = 0; i < 3; i++) {
                A a = new A();
                pm.makePersistent(a);
                oid = pm.getObjectId(a);
            }
            pm.currentTransaction().commit();
   
            pm.currentTransaction().begin();
            pm.newQuery("SELECT a FROM A a").deletePersistentAll();
            pm.currentTransaction().commit();
           
            pm.getObjectById(oid);
        }
       
        finally {
            pm.close();
            pmf.close();
        }
    }
   
    @PersistenceCapable
    public static class A {
    }
}

A way to reproduce the exception is required in order to proceed with working on this issue.

ObjectDB Support

Reply