hbwf / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

cache-key collision #801

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
version from 3.1.1 to 3.2.1

Please describe the problem.  Unit tests are best!
MyBatis with second level cache (ehcache), two Strings has same hashcode, so 
got wrong data from cache, two strings are "6339069Z038" and "6339069Z02W".

What is the expected output? What do you see instead?

Can you provide stack trace, logs, error messages that are displayed?

Please provide any additional information below.
"6339069Z038" and "6339069Z02W" has same hashcode 138544683, my sql is very 
sample "select * from some_table where id=#{id}", two ids has same cache key, 
so got wrong data from cache.

Original issue reported on code.google.com by xuyang1...@gmail.com on 28 Mar 2013 at 7:05

GoogleCodeExporter commented 9 years ago
Probably it is already fixed in
https://github.com/mybatis/ehcache-cache/commit/e5bcb6f0cdf52e8a1c04033fd0a9aad8
965acd0b

Can you try mybatis-ehcache 1.0.2-snapshot?

Original comment by eduardo.macarron on 28 Mar 2013 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 30 Mar 2013 at 11:47