Add a retry to database expunge routines
This commit is contained in:
parent
0e75c8ed39
commit
94eb12aca3
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.apache.commons.text.WordUtils;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.GsonBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.apache.commons.text.WordUtils;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -27,7 +27,7 @@ import ca.uhn.fhir.util.jar.DependencyLogFactory;
|
|||
import ca.uhn.fhir.util.jar.IDependencyLog;
|
||||
import com.ctc.wstx.api.WstxInputProperties;
|
||||
import com.ctc.wstx.stax.WstxOutputFactory;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.codehaus.stax2.XMLOutputFactory2;
|
||||
import org.codehaus.stax2.io.EscapingWriterFactory;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class XmlUtil {
|
|||
private static volatile XMLOutputFactory ourOutputFactory;
|
||||
|
||||
static {
|
||||
HashMap<String, Integer> validEntityNames = new HashMap<String, Integer>(1448);
|
||||
HashMap<String, Integer> validEntityNames = new HashMap<>(1448);
|
||||
validEntityNames.put("AElig", 0x000C6);
|
||||
validEntityNames.put("Aacute", 0x000C1);
|
||||
validEntityNames.put("Abreve", 0x00102);
|
||||
|
|
|
@ -335,7 +335,20 @@ public abstract class BaseJpaTest {
|
|||
|
||||
boolean expungeEnabled = theDaoConfig.isExpungeEnabled();
|
||||
theDaoConfig.setExpungeEnabled(true);
|
||||
|
||||
for (int count = 0;; count++) {
|
||||
try {
|
||||
theSystemDao.expunge(new ExpungeOptions().setExpungeEverything(true));
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
if (count >= 3) {
|
||||
ourLog.error("Failed during expunge", e);
|
||||
fail(e.toString());
|
||||
} else {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
theDaoConfig.setExpungeEnabled(expungeEnabled);
|
||||
|
||||
theSearchParamRegistry.forceRefresh();
|
||||
|
|
Loading…
Reference in New Issue