[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-29 Thread Damien Obrist (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16667430#comment-16667430
 ] 

Damien Obrist commented on JENA-1619:
-

[~andy.seaborne] thanks for the fix! I can confirm that with the latest 
3.10.0-SNAPSHOT the issue is resolved.

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Assignee: Andy Seaborne
>Priority: Major
> Fix For: Jena 3.10.0
>
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16664014#comment-16664014
 ] 

ASF GitHub Bot commented on JENA-1619:
--

Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/482


> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16664012#comment-16664012
 ] 

ASF subversion and git services commented on JENA-1619:
---

Commit c3027d69ac87763113322876816fb6292ef6cd6a in jena's branch 
refs/heads/master from [~an...@apache.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=c3027d6 ]

JENA-1619: Merge commit 'refs/pull/482/head' of https://github.com/apache/jena

This closes #482.


> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16664010#comment-16664010
 ] 

ASF subversion and git services commented on JENA-1619:
---

Commit cd75e6c1597db5da1adf2eb3decd5bd59877b266 in jena's branch 
refs/heads/master from [~an...@apache.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=cd75e6c ]

JENA-1619: Completely detach a binding by doing a copy.

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16664011#comment-16664011
 ] 

ASF subversion and git services commented on JENA-1619:
---

Commit c89ed1238bcee69918e7aeedaf52637c66ff315c in jena's branch 
refs/heads/master from [~an...@apache.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=c89ed12 ]

JENA-1619: Don't materialize bindings.

No need to materialize.
Bindings aren't safe outside a transaction anyway.

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-24 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16662355#comment-16662355
 ] 

Andy Seaborne commented on JENA-1619:
-

The solution in the PR is to do a proper binding copy to properly detacts the 
result from the transaction.

Some legacy code (which shouldn't have got copied into TDB2) can be removed. 

This may affect some non-transactional (and not recommended) use of TDB1, 
although the impact is on already unsafe code.

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16662346#comment-16662346
 ] 

ASF GitHub Bot commented on JENA-1619:
--

GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/482

JENA-1619:  Completely detach results by copying a binding.

cd75e6c fixes the presenting problem.
c89ed12 removes a related non-working feature in TDB1/TDB2.
4dc260e is reformatting.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena binding-copy

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/482.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #482


commit cd75e6c1597db5da1adf2eb3decd5bd59877b266
Author: Andy Seaborne 
Date:   2018-10-24T13:31:36Z

JENA-1619: Completely detach a binding by doing a copy.

commit c89ed1238bcee69918e7aeedaf52637c66ff315c
Author: Andy Seaborne 
Date:   2018-10-24T13:34:05Z

JENA-1619: Don't materialize bindings.

No need to materialize.
Bindings aren't safe outside a transaction anyway.

commit 4dc260eeb2f627f724f6a382f42819f3c9b51cd6
Author: Andy Seaborne 
Date:   2018-10-24T13:34:26Z

Cleanup formatting.




> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>

[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-24 Thread Damien Obrist (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16661831#comment-16661831
 ] 

Damien Obrist commented on JENA-1619:
-

You're welcome.

Indeed this is an interesting one :)

This makes sense and would explain the size factor. When I tried to debug why 
the changes in 
[9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]
 would lead to this new behavior I noticed the node table cache and suspected 
it might have something to do with it. But I wasn't able to pinpoint the issue.

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1619) TransactionException for large query results

2018-10-23 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16660989#comment-16660989
 ] 

Andy Seaborne commented on JENA-1619:
-

Thank you very much for the report.

On first reading, all I can say is that it is bizarre :-)

The size element maybe whether the node is in the NodeTableCache - the error is 
a node table cache miss. If that is the reason, the beginning of a copied 
result is more vulnerable (it is earlier and will be more at risk of 
cache-replacement).

> TransactionException for large query results
> 
>
> Key: JENA-1619
> URL: https://issues.apache.org/jira/browse/JENA-1619
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB2
>Affects Versions: Jena 3.9.0
> Environment: MacOS 10.14
> Java 1.8.0_161 (Oracle)
>Reporter: Damien Obrist
>Priority: Major
> Attachments: jena-transaction-exception-master.zip
>
>
> When querying a TDB2 dataset, I'm observing a suspicious 
> {{TransactionException}}, even though the query results have been copied so 
> they can be used outside of a transaction. The exception only seems to occur 
> when there are many results.
> h3. Reproduction steps
>  * Sample dataset containing 1'000'000 triples
>  * Query all triples:
> {code:java}
> SELECT * WHERE { ?s ?p ?o . }{code}
>  * Copy query results for use outside of transaction:
> {code:java}
> ResultSetFactory.copyResults(queryExecution.execSelect());{code}
>  * Get any variable of the first result
> All variables are {{null}} and the log shows the following exception:
> {noformat}
> org.apache.jena.dboe.transaction.txn.TransactionException: Not in a 
> transaction
>   at 
> org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.checkTxn(TransactionalComponentLifecycle.java:417)
>   at 
> org.apache.jena.dboe.trans.data.TransBinaryDataFile.read(TransBinaryDataFile.java:182)
>   at 
> org.apache.jena.tdb2.store.nodetable.TReadAppendFileTransport.read(TReadAppendFileTransport.java:71)
>   at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readByte(TCompactProtocol.java:637)
>   at 
> org.apache.thrift.protocol.TCompactProtocol.readFieldBegin(TCompactProtocol.java:543)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:222)
>   at org.apache.thrift.TUnion$TUnionStandardScheme.read(TUnion.java:213)
>   at org.apache.thrift.TUnion.read(TUnion.java:138)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableTRDF.readNodeFromTable(NodeTableTRDF.java:80)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:103)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:197)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:108)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:52)
>   at 
> org.apache.jena.tdb2.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
>   at org.apache.jena.tdb2.solver.BindingTDB.get1(BindingTDB.java:126)
>   at 
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:104)
>   at org.apache.jena.sparql.core.ResultBinding._get(ResultBinding.java:57)
>   at 
> org.apache.jena.sparql.core.QuerySolutionBase.get(QuerySolutionBase.java:33)
>   at TransactionException.main(TransactionException.java:27)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I have created a minimal example available on 
> [GitHub|https://github.com/dobrist/jena-transaction-exception] and attached 
> to this issue.
> h3. Findings
>  * The exception doesn't occur for smaller query results
>  * This seems to be a regression as it works as expected with Jena 3.8.0
>  * Using {{git bisect}} I have identified the commit where this starts to 
> happen: 
> [9a60253|https://github.com/apache/jena/commit/9a60253c00aec6763adbb0253588fe4dc0b484d4]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)