maheshwarirohit87 / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

Sort ordering not retained in result map #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using the "sort" option in SimpleDB, the ordering of the items is not 
retained.

In the implementation of the listItemsWithAttributes() method in Domain.java, 
it stores the results 
of the query in a Hashtable which does not retain insertion order.  This can be 
fixed by using a 
LinkedHashSet wrapped to retain the thread safety of the Hashtable.

Attached is a Subversion diff which implements this change to retain proper 
ordering of sorted 
query results.

Original issue reported on code.google.com by craigwblake@gmail.com on 28 Sep 2008 at 9:23

Attachments:

GoogleCodeExporter commented 9 years ago
fixed in SVN r192. I used a LinkedHashMap. I didn't wrap it because it isn't 
subject
to conditions which would affect thread safety. There is only one thread 
inserting
into a locally created collection.

Original comment by dkavan...@gmail.com on 6 Oct 2008 at 2:26

GoogleCodeExporter commented 9 years ago
It looks like the wrong Hashtable was converted to the LinkedHashSet.  The 
"params" map is only used in 
creating the request, the "results" Hashtable is the one that needs to be 
changed to affect the ordering of the 
returned items.

Original comment by craigwblake@gmail.com on 6 Oct 2008 at 2:36