Hibernate + 2nd level cache bug

Recently, I have come across a nasty bug. When Hibernate executes a cacheable query and applying a ResultTransformer on a result of that query, java.lang.ClassCastException is thrown. [crayon-60fb5f5b07e77028320718/] It seems that the ResultTransformer is applied on the result before putting it into cache. Cache expects Object list but it receives transformed results (in this case RateDTO list). It cannot deal with it and as a result exception is thrown. The bug is present in Hibernate 3.6.6.Final version. One of the workarounds

Continue Reading
Skip to toolbar