Duplicate CacheKey with several query parameters value on null (IBATIS-663)

View: New views
2 Messages — Rating Filter:   Alert me  

Duplicate CacheKey with several query parameters value on null (IBATIS-663)

by fcarballo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having a problem with cached stored procedures call, using null
parameters.
When I call a stored procedure like: "call user.some_sp(?,?)" I get the same
cacheKey for parameters: [1, null] and [null, 1]
I think that the problem is in class
com.ibatis.sqlmap.engine.exchange.BaseDataExchange on method getCacheKey:
for (int i = 0; i < data.length; i++) {
      if (data[i] != null) {
        key.update(data[i]);
      }
}

If the paramValue is null, it is ignored. Then when I get the cacheKey, on
the parameters
 values part, I get |1| for both parameters pair.

Re: Duplicate CacheKey with several query parameters value on null (IBATIS-663)

by fcarballo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey, no one found any solution to this? I really think that this is a serious bug. I'm using an ad-hoc version of ibatis, with this class modified. But I'll be glad to get this fix on a release version.

fcarballo wrote:
I'm having a problem with cached stored procedures call, using null
parameters.
When I call a stored procedure like: "call user.some_sp(?,?)" I get the same
cacheKey for parameters: [1, null] and [null, 1]
I think that the problem is in class
com.ibatis.sqlmap.engine.exchange.BaseDataExchange on method getCacheKey:
for (int i = 0; i < data.length; i++) {
      if (data[i] != null) {
        key.update(data[i]);
      }
}

If the paramValue is null, it is ignored. Then when I get the cacheKey, on
the parameters
 values part, I get |1| for both parameters pair.