expunge failure due to foreign key constraint

27 views
Skip to first unread message

ra...@apothesource.com

unread,
Apr 16, 2020, 12:47:34 PM4/16/20
to HAPI FHIR
We are using hapi-fhir 3.8.0 and are trying to implement system-level $expunge. When we execute with options set with: 

{
 "resourceType": "Parameters",
 "parameter": [
       {
     "name": "expungeDeletedResources",
     "valueBoolean": true
   },{
     "name": "expungePreviousVersions",
     "valueBoolean": false
   }
 ]
}

 expunge fails with java.util.concurrent.ExecutionException: org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [delete from HFJ_RESOURCE where RES_ID=? and RES_VER=?]; constraint [FHIRDB.FK_FORCEDID_RESOURCE]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch

Our implementation is calling the JpaSystemProviderDstu2.expunge operation so I'm wondering how we can resolve this issue. Has anyone else had this problem with expunge?




James Agnew

unread,
Apr 16, 2020, 1:21:40 PM4/16/20
to ra...@apothesource.com, HAPI FHIR
That is a fairly old version of HAPI FHIR, would you be able to try against current 5.0.0-SNAPSHOT builds to see if you still see the same issue? A number of bugs have been addressed relating to expunge since it was first introduced.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/92b20814-5a42-4b53-9401-fd59db84e97c%40googlegroups.com.

ra...@apothesource.com

unread,
Apr 20, 2020, 9:21:30 AM4/20/20
to HAPI FHIR
I tested with 4.1.0 (as we're about to upgrade to that) and it worked correctly - at least in the hapi-fhir-jpaserver-starter project. I expect it should work for us.

Thanks,
Randy

On Thursday, April 16, 2020 at 1:21:40 PM UTC-4, James Agnew wrote:
That is a fairly old version of HAPI FHIR, would you be able to try against current 5.0.0-SNAPSHOT builds to see if you still see the same issue? A number of bugs have been addressed relating to expunge since it was first introduced.

Cheers,
James

On Thu, Apr 16, 2020 at 12:47 PM <ra...@apothesource.com> wrote:
We are using hapi-fhir 3.8.0 and are trying to implement system-level $expunge. When we execute with options set with: 

{
 "resourceType": "Parameters",
 "parameter": [
       {
     "name": "expungeDeletedResources",
     "valueBoolean": true
   },{
     "name": "expungePreviousVersions",
     "valueBoolean": false
   }
 ]
}

 expunge fails with java.util.concurrent.ExecutionException: org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [delete from HFJ_RESOURCE where RES_ID=? and RES_VER=?]; constraint [FHIRDB.FK_FORCEDID_RESOURCE]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch

Our implementation is calling the JpaSystemProviderDstu2.expunge operation so I'm wondering how we can resolve this issue. Has anyone else had this problem with expunge?




--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages