hapi-fhir-jpaserver-starter icon indicating copy to clipboard operation
hapi-fhir-jpaserver-starter copied to clipboard

Hibernate error on Conditional create

Open cosminflorica opened this issue 4 years ago • 2 comments

Running

POST http://hapi.fhir.org/baseR4/Patient
Header: 
If-None-Exist: identifier=123a

Returns:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream"
    }
  ]
}

I think it will only return this error when only one Patient matches the identifier.

cosminflorica avatar Nov 15 '21 08:11 cosminflorica

Running the server locally, I have the same behavior when only one Patient matches the identifier. in eather cases: If-None-Exist: identifier=http://example|123 or If-None-Exist: identifier=123

By setting:

spring:
     datasource:
            hikari:
                   auto-commit: false

on application.yaml everything works as expected but I'm not sure how it will influence the transactions or queries.

cosminflorica avatar Nov 15 '21 08:11 cosminflorica

The server shouldn't return the error Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream. Please address this to https://github.com/hapifhir/hapi-fhir

jkiddo avatar Jan 08 '22 19:01 jkiddo