This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Attached is a repro that demonstrates a very severe bug in GetUniqueID. Which is causing some objects to be returned twice in a Find operation and others not to be returned at all. The bug is this: Given the following two Guids: 1) 00350037-0038-0034-4400-440031004100 Both return the same hash code of '1141702659' Of course, an Entities UniqueId which is used for cache lookup is dependent upon the hashcode of the Guid. My client actually discovered this bug because a few items in a grid were being duplicated. This really has to be rectified, a possible suggestion would be to hash the Guids manually instead of relying on the standard implementation of get hash code. Or maybe use guids themselves for cache purposes. And this has actually appeared for a few objects. I just tracked this one case down to put the repro together. Again, you guys have always respond greatly in the past, but this issue is affecting a production system. The bug causes some items two appear twice, and some not to appear. Please respond ASAP with any temp solutions. Thanks, Kavan
|
|
|
Hi Kavan, How were these guids generated as they seem to be very similar which is causing the collision. As a work-around can you regenerate these ids? I will look at a proper solution. Cheers, Andrew. |
|
|
Hi Andrew, They are just normal random Guids. And it is not just these two, the client observed about 6 or seven doubled records. I also see the similarity, but hashs are show discriminate with respect to even one bit being different. I just have no time to track the specific guids down right now as I'm working on the fix. I have kind of a quick hack workaround that I'm implementing now. Take a look at the modified repro which has two hash generating functions. They both take into account the id (both Guid and Object) as well as the table name. Even though Guids are universally unique some models will use the same guid in one-to-one extension schemes. So I understand the TableName hash needs to be in there. The downside is the hashs are now a guid (128 bits), but for consistency I think it is a price worth paying. Thanks, Kavan |
|
|
Hi Kavan, I've fixed the issue and forced a nightly build so you can pick it up from your store page. Cheers, Andrew. |
|
|
Andrew, Thank everyone for such a quick turnaround. Kavan |
|