You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Petr Knápek (JIRA)" <ji...@apache.org> on 2018/06/29 06:06:00 UTC
[jira] [Created] (METAMODEL-1190) ClassCastException when getting
value from DB
Petr Knápek created METAMODEL-1190:
--------------------------------------
Summary: ClassCastException when getting value from DB
Key: METAMODEL-1190
URL: https://issues.apache.org/jira/browse/METAMODEL-1190
Project: Apache MetaModel
Issue Type: Bug
Affects Versions: 5.0.0
Reporter: Petr Knápek
Attachments: metamodel-bug.zip
We use MetaModel with Postgres/MsSQL in our project and when system processes many data and queries DB tables in parallel then queuries suddenly fails with exception like this
'java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Boolean'.
This exception is thrown when org.apache.metamodel.data.Row.getValue(Column) is executed and result is to be saved to variable. The problem occurs time and again.
It looks like that AbstractRow.getIndex(Column) which is invoked in getValue(Column) returns wrong column index and that's why value of another column is get.
I think the cause of problem is in org.apache.metamodel.data.CachingDataSetHeader.indexOf(Column) which uses System.identityHashCode(Object) for generating keys. This method can return the same values for different objects.
Attached is testing class which reproduces problem.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)