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

[Handle-info] Sort order for handle values



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