[ome-devel] API call can crash server 5.1.4
Aleksandra Tarkowska (Staff)
A.Tarkowska at dundee.ac.uk
Fri Feb 12 22:47:59 GMT 2016
I forgot to mention, if regular select is too slow, you can either use limit and offset or IQuery projection. Query will look like:
“””
select new map(img.id as id,
img.name as name,
pix.sizeX as sizeX,
orf.path as path
)
from Image img
left outer join img.pixels pix
left outer join img.fileset as fs
left outer join fs.usedFiles as uf
left outer join uf.originalFile orf
where img.details.owner.id = :id and
not exists (
select obl from DatasetImageLink as obl
where obl.child=img.id)
and not exists (
select ws from WellSample as ws where ws.image=img.id )
order by lower(img.name), img.id
"""
Ola
Software Engineer
Open Microscopy Environment
University of Dundee
On 12 Feb 2016, at 22:07, Aleksandra Tarkowska (Staff) <A.Tarkowska at dundee.ac.uk<mailto:A.Tarkowska at dundee.ac.uk>> wrote:
Hi Damir
Thanks for reporting having an issue with query.
Inorder to load orphaned images your query should be:
sql = """select img from Image img
join fetch img.fileset as fs
join fetch fs.usedFiles as uf
join fetch uf.originalFile as of
join fetch img.pixels as pxl
join fetch pxl.pixelsType as pxt
where
not exists (
select obl from DatasetImageLink as obl
where obl.child=img.id)
and not exists (
select ws from WellSample as ws where ws.image=img.id )
order by lower(img.name), img.id
“""
You have to check if DatasetImageLink exist rather then dataset id is null
Please remember that image can be in Plate.
Let us know if that works better
Ola
Software Engineer
Open Microscopy Environment
University of Dundee
On 12 Feb 2016, at 19:56, Damir Sudar <dsudar at lbl.gov<mailto:dsudar at lbl.gov>> wrote:
Hi all,
We're using the API to query the OMERO server (currently running 5.1.4) and have run into a situation where this can crash the server or at least get the server into a state where it becomes unresponsive. A hopefully useful chunk from the OMEROweb.log is enclosed. I did not see anything in the other logs that appeared related to the activity that caused the crash or the crash itself. An excerpt of the code that causes the crash is here:
const std::string orphanedImagesQueryString =
"select img from Image as img "
"left outer join fetch img.datasetLinks as idl "
"left outer join fetch idl.parent as dst "
"left outer join fetch img.fileset as fs "
"join fetch fs.usedFiles as uf "
"join fetch uf.originalFile as of "
"join fetch img.pixels as pxl "
"join fetch pxl.pixelsType as pxt ";
// "where dst.id<http://dst.id/> is null";
omero::sys::ParametersIPtr dsParams = new omero::sys::ParametersI();
dsParams->addLong("id", omero::rtypes::rlong(803));
auto imageObjects = query->findAllByQuery(orphanedImagesQueryString, dsParams);
for (auto image : omero::cast<omero::model::ImagePtr>(imageObjects)) {
std::cout << "i: " << image->getId()->getValue() << " " << image->getName()->getValue() << "\n";
}
I'm not sure, but as I understand, the crash occured when I commented "where dst.id<http://dst.id/> is null" condition. The query with "where dst.id<http://dst.id/> is null" didn't return result and I tried to remove the "is null" condition - to see what would happen. And the server crashed.
It appears that the server crashed when we tried to query images without parent dataset ("orphaned images”). I.e. something related to handling a situation where a parent pointer is NULL.
- Damir
--
Damir Sudar - Staff Scientist
Lawrence Berkeley National Laboratory
One Cyclotron Road, MS 977, Berkeley, CA 94720, USA
T: 510/486-5346 - F: 510/486-5586 - E: DSudar at lbl.gov<mailto:DSudar at lbl.gov>
Visiting Scientist, Oregon Health and Science University
<omeroweb.log>_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20160212/dcbdfec2/attachment.html>
More information about the ome-devel
mailing list