Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 393114

Summary: [DB] ClassCastException when starting CDO Server recovering from crash, with Oracle DB
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.dbAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Eike Stepper CLA 2012-10-30 02:28:06 EDT
Cloned from: 392995: [DB] ClassCastException when starting CDO Server recovering from crash, with Oracle DB
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392995

Created attachment 222911 [details]
Patch

When starting the CDO Server and it detected it was crashed last time (because it was not stopped gracefully), a ClassCastException is thrown when using an Oracle DB:

java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer
 at org.eclipse.emf.cdo.server.internal.db.MetaDataManager$1.handle(MetaDataManager.java:356)

I'm not sure if it is supposed that the array has 2 BigDecimal values instead of an Integer and a Long (positions 1 and 2, respectively), when using Oracle. Maybe there is some wrong mapping somewhere. But if it's supposed to be like that, then I propose to change the code to parse the Integer and Long from the toString() result of each value, instead of try to make a cast.

Attached a patch with this change, that was tested with H2 and Oracle.
Comment 1 Eike Stepper CLA 2012-10-30 02:32:54 EDT
commit 67f5f89c73bc0061a373bc92cc05d8a6ebc777ae
Comment 2 Eike Stepper CLA 2013-06-27 03:33:46 EDT
Available in R20130613-1157 (4.2)