mirror of https://github.com/apache/lucene.git
SOLR-996 had an incorrect fix.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@788291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0543d2d71
commit
a678924f96
|
@ -307,7 +307,6 @@ public class DocBuilder {
|
|||
ContextImpl ctx = new ContextImpl(entity, vr, null,
|
||||
pk == null ? Context.FULL_DUMP : Context.DELTA_DUMP,
|
||||
session, parentCtx, this);
|
||||
vr.context = ctx;
|
||||
entityProcessor.init(ctx);
|
||||
|
||||
if (requestParameters.start > 0) {
|
||||
|
@ -347,7 +346,6 @@ public class DocBuilder {
|
|||
|
||||
Map<String, Object> arow = entityProcessor.nextRow();
|
||||
if (arow == null) {
|
||||
entityProcessor.destroy();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -425,6 +423,7 @@ public class DocBuilder {
|
|||
if (verboseDebug) {
|
||||
writer.log(SolrWriter.END_ENTITY, null, null);
|
||||
}
|
||||
entityProcessor.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -587,7 +586,6 @@ public class DocBuilder {
|
|||
|
||||
EntityProcessor entityProcessor = getEntityProcessor(entity);
|
||||
ContextImpl context1 = new ContextImpl(entity, resolver, null, Context.FIND_DELTA, session, null, this);
|
||||
resolver.context = context1;
|
||||
entityProcessor.init(context1);
|
||||
|
||||
Set<Map<String, Object>> myModifiedPks = new HashSet<Map<String, Object>>();
|
||||
|
|
|
@ -49,6 +49,8 @@ public class EntityProcessorWrapper extends EntityProcessor {
|
|||
|
||||
protected List<Map<String, Object>> rowcache;
|
||||
|
||||
private Context contextCopy;
|
||||
|
||||
public EntityProcessorWrapper(EntityProcessor delegate, DocBuilder docBuilder) {
|
||||
this.delegate = delegate;
|
||||
this.docBuilder = docBuilder;
|
||||
|
@ -58,6 +60,9 @@ public class EntityProcessorWrapper extends EntityProcessor {
|
|||
rowcache = null;
|
||||
this.context = context;
|
||||
resolver = (VariableResolverImpl) context.getVariableResolver();
|
||||
//context has to be set correctly . keep the copy of the old one so that it can be restored in destroy
|
||||
contextCopy = resolver.context;
|
||||
resolver.context = context;
|
||||
if (entityName == null) {
|
||||
onError = resolver.replaceTokens(context.getEntityAttribute(ON_ERROR));
|
||||
if (onError == null) onError = ABORT;
|
||||
|
@ -255,6 +260,8 @@ public class EntityProcessorWrapper extends EntityProcessor {
|
|||
|
||||
public void destroy() {
|
||||
delegate.destroy();
|
||||
resolver.context = contextCopy;
|
||||
contextCopy = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,7 @@ public class VariableResolverImpl extends VariableResolver {
|
|||
/**
|
||||
* Used for creating Evaluators
|
||||
*/
|
||||
ContextImpl context;
|
||||
Context context;
|
||||
|
||||
private final TemplateString templateString = new TemplateString();
|
||||
|
||||
|
|
Loading…
Reference in New Issue