You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Martin Hák (JIRA)" <ji...@apache.org> on 2018/10/09 05:58:00 UTC
[jira] [Commented] (METAMODEL-1190) ClassCastException when getting
value from DB
[ https://issues.apache.org/jira/browse/METAMODEL-1190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16642841#comment-16642841 ]
Martin Hák commented on METAMODEL-1190:
---------------------------------------
whe would be possible to calcute with fix,pls?
> 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
> Priority: Major
> 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)