Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.0.0
-
None
-
None
Description
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.