327 words

ClassCastException on closing PersistenceManager

#1
2015-10-14 13:53

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.

 

jakab
jakab's picture
Joined on 2011-05-12
User Post #30
#2
2015-10-15 13:03

The stack trace indicates an issue in the implementation of the new embeddable detachment feature. Since this feature was requested by you recently and requires enabling explicitly you may be the only user affected.

Build 2.6.4_01 includes an attempt to fix this exception.

This issue cannot damage the database, so restarting your application with the same database (instead of a backup database) should be safe.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,318
#3
2015-10-15 14:38

Today I got a similar but different exception on the same database also on closing PersistenceManager:

java.lang.ClassCastException: com.objectdb.spi.DetachedTracker 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:371)
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)

 

I had to return again to a working backup of the DB. It is quite alarming.

jakab
jakab's picture
Joined on 2011-05-12
User Post #31
#4
2015-10-15 14:38

I just read ur answer. Once the bug appeared, it was coming also after restart of the application right away. Only returning to an older backup seems to help.
I will try now the new build of objectDB with the fix.

jakab
jakab's picture
Joined on 2011-05-12
User Post #32
#5
2015-10-15 14:42

#3 stack is the same issue. Unfortunately this is the risk of being the first to use a new feature.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,320
#6
2015-10-15 14:42

With the fixed version the application starts again without need to return to backup.

So far so good.

Thanks!

jakab
jakab's picture
Joined on 2011-05-12
User Post #33

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel