New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jpa server example fails with search parameter list with more than 5 elements #744

Closed
c-schuler opened this Issue Oct 4, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@c-schuler
Contributor

c-schuler commented Oct 4, 2017

I have been struggling with this issue in my implementation. In an effort to resolve I built the hapi-jpa-fhir-example and was hoping to bring in my code bit by bit until I discovered the issue. However, the example has the issue straight away.

This works fine:
http://localhost:8080/hapi-fhir-jpaserver-example/baseDstu3/Condition?code=http%3A%2F%2Fsnomed.info%2Fsct%7C447395005,http%3A%2F%2Fsnomed.info%2Fsct%7C1701000119104,http%3A%2F%2Fsnomed.info%2Fsct%7C187757001,http%3A%2F%2Fsnomed.info%2Fsct%7C187758006&patient=Patient-12214

However this returns a 500 with a processing error:
http://localhost:8080/hapi-fhir-jpaserver-example/baseDstu3/Condition?code=http%3A%2F%2Fsnomed.info%2Fsct%7C447395005,http%3A%2F%2Fsnomed.info%2Fsct%7C1701000119104,http%3A%2F%2Fsnomed.info%2Fsct%7C187757001,http%3A%2F%2Fsnomed.info%2Fsct%7C187758006,http%3A%2F%2Fsnomed.info%2Fsct%7C487395005,http%3A%2F%2Fsnomed.info%2Fsct%7C269544008,http%3A%2F%2Fsnomed.info%2Fsct%7C285312008&patient=Patient-12214

I know the fhirtest server works in both cases, so I investigated that and found something interesting. In the web.xml, ca.uhn.fhirtest.config.DbServerConfig is specified as the context config, but it's an empty class with the last commit message stating "JPA server was not correctly validating and expanding SCT codes", which seems related to the issue I am having. I tried to imitate this in my implementation, but I get missing bean errors.

I would love some guidance on how to bypass this issue. Thanks!

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Oct 4, 2017

Owner

AUUUUGGHHHHH stupid derby :)

This is an issue i have worked around a million times and it has burned me yet again

The longer query isn't failing for any interesting reason related to the codes or the parameters or anything like that... it's failing because it's longer than 256 characters and Derby's version of a CLOB column defaults to that asinine length unless you are explicit that you want longer, and gives a meaningless NullPointerException if you exceed that.

Fix coming up.

Owner

jamesagnew commented Oct 4, 2017

AUUUUGGHHHHH stupid derby :)

This is an issue i have worked around a million times and it has burned me yet again

The longer query isn't failing for any interesting reason related to the codes or the parameters or anything like that... it's failing because it's longer than 256 characters and Derby's version of a CLOB column defaults to that asinine length unless you are explicit that you want longer, and gives a meaningless NullPointerException if you exceed that.

Fix coming up.

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Oct 4, 2017

Owner

BTW the reason it's not failing on fhirtest is because we use Postgres there. For what it's worth, I'm not sure how "real" the thing you are doing is, but if it's anything more than a basic POC I'd highly recommend using PG/MySQL/MSSQL/Oracle/etc instead of Derby.

Owner

jamesagnew commented Oct 4, 2017

BTW the reason it's not failing on fhirtest is because we use Postgres there. For what it's worth, I'm not sure how "real" the thing you are doing is, but if it's anything more than a basic POC I'd highly recommend using PG/MySQL/MSSQL/Oracle/etc instead of Derby.

@c-schuler

This comment has been minimized.

Show comment
Hide comment
@c-schuler

c-schuler Oct 4, 2017

Contributor

There is no particular reason why I am using Derby other than it was used in the JPA example I used to flesh out my implementation. I will switch to one of the dbs you suggested.
Thanks James.

Contributor

c-schuler commented Oct 4, 2017

There is no particular reason why I am using Derby other than it was used in the JPA example I used to flesh out my implementation. I will switch to one of the dbs you suggested.
Thanks James.

@jamesagnew jamesagnew closed this in 0ab8a9a Oct 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment