Hi, I am using Hibernate 3.2.6ga Ehcache 1.4.1 All works well, but when i enable EHCACHE and use in hibernate like: CODE 1: .... ... SQLQuery sql = session.createSQLQuery("select empName, empAddress from emp where id=5"); sql.list(); .. .. --> This throws a ArrayINdexOutOfBound Exception.
To avoid this i did the following and it started working CODE 2: .... ... SQLQuery sql = session.createSQLQuery("select empName, empAddress from emp where id=5"); sql.addScalar("empName",Hibernate.STRING); sql.addScalar("empAddress",Hibernate.STRING); sql.list(); ..--> NOW it works fine.
I already have a tons of code that are written without addScalar (like in CODE 1). So please help me if can avoid going throw code and adding this scalar at million places? What can i do? Is there any hibernate or Ehcache setttings that can help it. I read some where that EHcache is suppose to take care of this automatically? Is this a Bug? FINDINGs --------- The problem is if i enable QUERY CACHE and USE CODE 1 the INDEXOUTOFBOUND ERROR OCCURS. IF i disable QUERY CACHE and USE CODE 1 it works. I am forced to USE CODE 2 if i enable QUERY CACHE.
So Please help! Thanks in Advance Hari
Last edited by haribalan on Sun Jun 27, 2010 10:15 am, edited 1 time in total.
|