Hi,
I am using ObjectDB 2.6.3.b03 via JDO. Today I got the following exception while closing the PersistenceManager after reading the DB:
java.lang.ClassCastException: com.objectdb.o.ENT cannot be cast to com.objectdb.o.EMT at com.objectdb.o.MMM.ah(MMM.java:1117) at com.objectdb.o.MMM.ai(MMM.java:1133) at com.objectdb.o.MMM.ag(MMM.java:1096) at com.objectdb.o.EMT.n(EMT.java:201) at com.objectdb.o.MMM.ah(MMM.java:1121) at com.objectdb.o.MMM.ag(MMM.java:1086) at com.objectdb.o.EMT.n(EMT.java:201) at com.objectdb.o.MMM.ah(MMM.java:1121) at com.objectdb.o.MMM.ai(MMM.java:1133) at com.objectdb.o.MMM.ag(MMM.java:1096) at com.objectdb.o.ENT.D(ENT.java:356) at com.objectdb.o.STA.af(STA.java:835) at com.objectdb.o.STM.D(STM.java:367) at com.objectdb.o.OBC.ag(OBC.java:198) at com.objectdb.o.OBM.close(OBM.java:198) at eu.extech.serverImpl.jdo.JDOConnection.close(Unknown Source)
the method on the bottom of the stack trace looks like this:
private PersistenceManager persistenceManager; public void close() { if( ! this.persistenceManager.isClosed()) { if (this.persistenceManager.currentTransaction().isActive()) { this.persistenceManager.currentTransaction().rollback(); } this.persistenceManager.close(); } }
It looks like it's related to the state of the DB. I replaced the non-working DB file (although the Doctor was saying the Db file has no errors) with an older backup and the code was running without errors.
However it worries me how did it com to this state and if it can happen again.
Maybe there is something I can do to prevent it next time.