Hello,
On 11.04.2013 14:13, Andy Seaborne wrote:
On 10/04/13 15:23, "Dr. André Lanka" wrote:
To break the connection,
1/ use ResultSet.nextBinding() which returns the low level, unconnected
graph Nodes.
It doesn't help. I tried to "copy" the bindings into a new resultSet
using ResultSet.nextBinding(). Then I deleted the store (to detect
really all connections) and still got a NPE (which is logged and
swallowed in BindingTDB [StackTrace below]).
So I think recreating the bindings seems to be necessary in our case.
2/ Much like your code - you could use ResultSetStream itself, create a
QueryIterator of the Bindings passing in a memory model to the
constructor of ResultSetStream.
Simple passing seems not to be enough (because of BindingTDB).
I'll change ResultSetStream to take a Iterator<binding> in place of
QueryIterator (which implements Iterator<binding>) to make it easier.
3/ Processing style - consume the ResultSet inside the transaction and
pass a different datastructure passed end(). You'll need to use up the
query results anyway.
We need to cache resultSets for performance reasons without leaving the
read transaction open. However, the code I sent creates another
datastructure, so we did essentially 3/ :-)
Best
André
get1(?s)
java.lang.NullPointerException
at
com.hp.hpl.jena.tdb.nodetable.NodeTableCache.toString(NodeTableCache.java:258)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:101)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:74)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:55)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:67)
at
com.hp.hpl.jena.tdb.transaction.NodeTableTrans.getNodeForNodeId(NodeTableTrans.java:111)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:55)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:67)
at com.hp.hpl.jena.tdb.solver.BindingTDB.get1(BindingTDB.java:123)
at
com.hp.hpl.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:123)
at
com.hp.hpl.jena.sparql.engine.binding.BindingProjectBase.get1(BindingProjectBase.java:65)
at
com.hp.hpl.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:123)
at com.hp.hpl.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
at
com.hp.hpl.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
--
Dr. André Lanka * 0178 / 134 44 47 * http://dr-lanka.de