try to commit in case of failure which hopefully frees up some RAM

pull/1/head
Michael Peter Christen 12 years ago
parent 409d6edf53
commit 1c4c1c0345

@ -172,7 +172,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
if (this.server == null) return;
try {
if (solrdoc.containsKey("_version_")) solrdoc.setField("_version_",0L); // prevent Solr "version conflict"
this.server.add(solrdoc, -1);
this.server.add(solrdoc, -1);
} catch (Throwable e) {
// catches "version conflict for": try this again and delete the document in advance
try {
@ -181,7 +181,12 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
try {
this.server.add(solrdoc, -1);
} catch (Throwable ee) {
throw new IOException(ee);
try {
this.server.commit();
this.server.add(solrdoc, -1);
} catch (Throwable eee) {
throw new IOException(eee);
}
}
}
}

Loading…
Cancel
Save