private List getAllRegistryObjectVersions(RegistryObjectType ro) throws RegistryException { if (versions == null) { ServerRequestContext queryContext = null; // Note: ORDER BY versionName DESC is not safe because String(1.10) < String(1.9) String query = "SELECT ro.* FROM " + Utility.getInstance().mapTableName(ro) + " ro WHERE ro.lid = '" + ro.getLid() + "'"; try { AdhocQueryRequest queryRequest = bu.createAdhocQueryRequest(query); queryContext = new ServerRequestContext("VersionProcessor.getAllRegistryObjectVersions", queryRequest); queryContext.setUser(ac.registryOperator); AdhocQueryResponseType queryResp = qm.submitAdhocQuery(queryContext); versions = queryResp.getRegistryObjectList().getIdentifiable(); queryContext.commit(); queryContext = null; } catch (JAXBException e) { throw (new RegistryException(e)); } catch (JAXRException e) { throw (new RegistryException(e)); } finally { if (queryContext != null) { queryContext.rollback(); } } } return (versions); }