[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Sort order for handle values



Order of handle values has never been specified.  Looking at the hdl.handle.net proxy, if you just have two URL values which one is chosen should be seen as random.  (It is deterministic at the proxy based on the server's response, but the server's response, as you have seen, is not deterministic.)

The preferred way to specify multiple redirection points is 10320/loc, as described in the handle technical manual.

An older but still workable solution is to use "URL" for your primary redirection point, and "subtypes" like "URL.METADATA" for others.

Finally, as you have seen, if you use SQL storage you can make your server return the handle values in a specific order.  Instead of recompiling the server, you can also use the configuration option "get_handle_stmt" in your "sql_settings".

Robert

On 2014-11-07, at 09:48 , Vasold, Gunter (gunter.vasold@uni-graz.at) <gunter.vasold@uni-graz.at> wrote:

> Hi,
>  
> I found out today that the sort order of handle values has changed on my server recently. Those values used to be displayed sorted by index, but today index 2 was listed before index 1. As a consequence the default view on my Handle-referenced objects has changed from content to metadata.  
>  
> I’m using PostgreSQL as database backend and suppose that some database optimization  has caused this behavior.  When looking at the code I found in  server/SQLHandleStorage.java
>  
> private String GET_HDL_STMT =
>     "select idx, type, data, ttl_type, ttl, timestamp, refs, admin_read, "+
>     "admin_write, pub_read, pub_write from handles where handle = ?";
>  
> I changed this to
>  
> private String GET_HDL_STMT =
>     "select idx, type, data, ttl_type, ttl, timestamp, refs, admin_read, "+
>     "admin_write, pub_read, pub_write from handles where handle = ? order by idx";
>  
> to make sure that the handle values are ordered by index, which solved my problem.
>  
> I’m not sure if there is an intended sort order for handle values, but at least my expectation was that they were sorted by index. So maybe it would make sense to add the ‘order by’  for future versions.
>  
> Regards,
>  
> Gunter
>  
> Gunter Vasold
> Research Technologist
> Centre for Information Modelling – Austrian Centre for Digital Humanities
> Karl-Franzens-Universität Graz
> Merangasse 70, A-8010 Graz
> Phone: +43 316 380 8012
>  


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info