473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Possible bug using arraylist.sort IComparer and .net webservices and .net framework 1.1

Our team has just fixed a really nasty problem that appears to be
caused by an obscure bug in the sort method of Arraylist and
daisy-chained webservice stubs.

We've fixed the bug so I'll not investigate any further but there was
nothing about it when googling the newsgroups so I am posting a note in
case it helps somebody else out.

The problem was in a system with a web front end calling through to a
chain of 3 webservices i.e.

WebUI->WebServiceA->WebServiceB->WebServiceC

A Business object that exposed an arraylist of other bus. objects was
exposed in WebServiceC with stubs referenced by WebService A, B and
WebUI in a daisy-chain.

This arraylist was being custom sorted in WebServiceC using
Arraylist.Sort() and an IComparer interface implemented in the objects
making up the list. This code worked fine in production in Dec 2004
but, with no code changes to this part of the code we have had problems
with the August 2005 release.

The arraylist was being returned to the UI with overwritten entries,
missing entries and not sorted as expected. Only occasionally, not
faithfully reproducible and not reproducible in the development
environment, only system & UAT.

Tracing showed that the problem was not in code at all as we dumped the
arraylist just before the return call from B and just after the return
to A. It was happening in the serialisation/deserialisation of the
business object result between WebserviceB and WebserviceA. Obviously
we didn't think that the problem was in something we were doing in
WebserviceC but that appears to be the case from the fix.

In the end we found that the problem went away only if we used sort on
a new instance of an arraylist in WebServiceC (after an item by item
copy) and did an item by item copy back into the target ArrayList.

For lack of a reasonable answer it appears that the arraylist was
trying to "remember" its sort and serialisation was trying to do
something clever between Webservice B & A but because the IComparer
interface was not implemented in the stub between B & A things went
awol.

Sounds like pure fantasy but the "fix" did nothing special besides
sorting a separate arraylist instance and copying the items back in. We
didn't solve the problem until we started grasping at straws so if you
are having a similar weird problem this post might help.

Nov 23 '05 #1
0 1653

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Adam | last post by:
Hi, I've got a class which contains a number of properties which in turn are read from a database. For example: class TData public property firstName <get and set here> public property...
3
by: Adam J. Schaff | last post by:
Hello. I recently noticed that the Sort method of the .NET ArrayList class does not behave as I expected. I expect 'A' < '_' < 'a' (as per their ascii values) but what I got was the opposite....
16
by: Dennis | last post by:
I have a class named "myclass" and an arraylist containing elements of type "MyClass". I want to get the value of a property of "MyClass" (a string type) for one of the arraylist elements. I...
7
by: Derek Martin | last post by:
Hi there, I've asked before but never got an answer that could get me completely to where I was heading. I have an arraylist that contains defined objects and I would like to sort this arraylist...
3
by: RJN | last post by:
Hi I have a user defined data type which implements IComparable interface and has an implementation for the CompareTo method. Public Class MyDataType Implements IComparable --Private...
16
by: RCS | last post by:
So I have an ArrayList that gets populated with objects like: myAL.Add(new CustomObject(parm1,parm2)); I'm consuming this ArrayList from an ObjectDataSource and would like to have this support...
5
by: Disccooker | last post by:
and i'm lost. any ideas? It's an object with a public property that is an Int. i receive an Array of these objects and copy them to an arraylist. i need to sort it based on this property and i...
48
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a...
3
by: jtfaulk | last post by:
Re: ArrayList, Sort, Menu, IComparer, Object, multidemensional I have a multi-dimensional arraylist, and I would like to sort one level of it but not all. The multi-dimensional arraylist...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.