Package ca.uhn.fhir.jpa.delete
Class ThreadSafeResourceDeleterSvc
java.lang.Object
ca.uhn.fhir.jpa.delete.ThreadSafeResourceDeleterSvc
Used by
CascadingDeleteInterceptor
to handle DeleteConflictList
s in a thead-safe way.
Specifically, this class spawns an inner transaction for each DeleteConflictList
. This class is meant to handle any potential delete collisions (ex ResourceGoneException
or ResourceVersionConflictException
. In the former case, we swallow the Exception in the inner transaction then continue. In the latter case, we retry according to the RETRY_BACKOFF_PERIOD and RETRY_MAX_ATTEMPTS before giving up.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
static final int
-
Constructor Summary
ConstructorDescriptionThreadSafeResourceDeleterSvc
(DaoRegistry theDaoRegistry, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster, IHapiTransactionService theTransactionService) -
Method Summary
Modifier and TypeMethodDescriptiondelete
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, DeleteConflictList theConflictList, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails)
-
Field Details
-
RETRY_BACKOFF_PERIOD
- See Also:
-
RETRY_MAX_ATTEMPTS
- See Also:
-
-
Constructor Details
-
ThreadSafeResourceDeleterSvc
public ThreadSafeResourceDeleterSvc(DaoRegistry theDaoRegistry, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster, IHapiTransactionService theTransactionService)
-
-
Method Details
-
delete
public Integer delete(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, DeleteConflictList theConflictList, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Returns:
- number of resources that were successfully deleted
-