MnifOmar commented on issue #1499:
URL: https://github.com/apache/jena/issues/1499#issuecomment-3201223836
@afs My apologies for not including a stack trace earlier. I’ve since
updated my code to explicitly call `connection.commit()` and then
`connection.end()` in a `finally` block, and that resolved the issue.
In my case, the problem was triggered by a recursive function in my Java
code that executes a very large number of SPARQL queries. The stack trace I
encountered was the same as the one already reported above:
```
java.lang.Error: Maximum lock count exceeded...
```
here is my updated function
@Override
public void select(String query, Consumer<List<QuerySolution>> action) {
List<QuerySolution> solutions = new ArrayList<>();
try {
connection.begin(ReadWrite.READ);
var q = QueryFactory.create(query);
connection.querySelect(q, solutions::add);
connection.commit();
action.accept(solutions);
} catch (Exception e) {
Log.error("Error executing query on remote triple store: {}",
e.getMessage(), e);
throw new RuntimeException("Error retrieving triples from remote
triple store", e);
} finally {
connection.end();
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]