-->
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.  [ 1 post ] 
Author Message
 Post subject: Query cache always misses query with array parameter
PostPosted: Thu Apr 20, 2006 11:53 am 
Newbie

Joined: Thu Jul 21, 2005 5:37 am
Posts: 9
Location: Paris
Hi,

I've tried to take advantage of the query cache on our application. Actually on a specific use case, the same query is run many times, and after a while there's good chance that this query has been run with all possible parameters .
The problem is that the query cache always misses. I think this is because the sole parameter is a user defined type which maps a Java byte array to an SQL VARCHAR.
In fact, the query cache uses a string representation of the query and its parameters as the key. Unfortunately, it simply calls the toString() method on the value field, hence getting the default toString() for a byte array.

This means that even if two byte array parameters are equal (Arrays.equals()), there will be a query cache miss, no matter if the same query with the same parameter value was executed before.

So, I wonder : Shouldn't the query key use the toString(Object value) method defined in NullableType rather the 'raw' toString() on the value ?

I'd like to know if I've completely lost it, or if this is a potential Hibernate bug.

Thanks,

Gregory

Hibernate version: 3.0.5


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

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.