-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Ehcache Usage throws IndexOutOfBound if used on SqlQuery
PostPosted: Sat Jun 26, 2010 2:33 pm 
Newbie

Joined: Sat Jun 26, 2010 2:23 pm
Posts: 4
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.

Top
 Profile  
 
 Post subject: Re: Ehcache Usage throws IndexOutOfBound if used on SqlQuery
PostPosted: Sun Jun 27, 2010 10:09 am 
Newbie

Joined: Sat Jun 26, 2010 2:23 pm
Posts: 4
Actually the above error is thrown when i ENABLE QUERY CACHE in the hibernate properties.
So if i disable Query Cache and run with CODE 1 it works. But with ENABLED Query Cache COde 1 does not work
and i am forced to use CODE 2.
Thanks
Hari


Top
 Profile  
 
 Post subject: Re: Ehcache Usage throws IndexOutOfBound if used on SqlQuery
PostPosted: Sun Jul 04, 2010 5:15 pm 
Newbie

Joined: Sat Jun 26, 2010 2:23 pm
Posts: 4
can some one help?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.