BatchExecutorClient doesn't persist anything


#1

Hello,

I am using the following code to insert entities in a loop, and nothing seems to be persisted:

this.loader = BatchExecutorClient.newBuilderforURI(new SimpleURI(url)).requestLogEnabled(true).build();

InsertQuery insertEntityQuery = Graql.insert(Graql.var().isa("entityX").has("attr1", "val1").has("attr2", "val2"));
loader.add(insertEntityQuery, this.keyspace);
...
loader.close();

If I use the following code instead, it works - I can see GRAKN is trying to persist the data (there is another issue with it, but it’s not related):

	QueryBuilder qb = this.session.open(GraknTxType.WRITE).graql();
	InsertQuery tmpInsert = qb.insert(Graql.var().isa("entityX").has("attr1", "val1").has("attr2", "val2"));
	tmpInsert.execute();

FYI - When I am using the loader, sometimes I am getting errors, sometimes no errors - but the data is still not persisted:

java.lang.RuntimeException: Unexpected exception while retrying, 12 queries failed.
at ai.grakn.client.BatchExecutorClient$CommandQueries.run(BatchExecutorClient.java:400)
at ai.grakn.client.BatchExecutorClient$CommandQueries.run(BatchExecutorClient.java:330)
at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
Caused by: java.util.concurrent.ExecutionException: com.sun.jersey.api.client.ClientHandlerException: java.io.IOException: Invalid Http response
at com.github.rholder.retry.Retryer$ExceptionAttempt.(Retryer.java:254)
at com.github.rholder.retry.Retryer.call(Retryer.java:163)
at ai.grakn.client.BatchExecutorClient$CommandQueries.run(BatchExecutorClient.java:381)
… 30 common frames omitted

I don’t get anything specific or helpful in the returned error responses.

Thank you
Angel


#2

Even with the following code, nothing gets persisted:

		GraknSession session = RemoteGrakn.session(new SimpleURI(url), keyspace);
		QueryBuilder qb = session.open(GraknTxType.WRITE).graql();
		qb.parse("insert $someEntity has attr1  \"val1\" has attr2 \"val2
"").execute();
		session.close();

If i put the insert query text in the web interface, it works fine and the entity is created.

Thank you