You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/03/16 21:28:01 UTC
[2/2] jena git commit: Minimal fix for JENA-903.
Minimal fix for JENA-903.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/503a7350
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/503a7350
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/503a7350
Branch: refs/heads/master
Commit: 503a73504dab01485bd6de5b41b9cd1d04065e80
Parents: 6977bdf
Author: Andy Seaborne <an...@apache.org>
Authored: Mon Mar 16 20:27:38 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Mon Mar 16 20:27:38 2015 +0000
----------------------------------------------------------------------
.../apache/jena/query/text/TextDocProducerEntities.java | 11 ++++++++---
.../apache/jena/query/text/TextDocProducerTriples.java | 9 +++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/503a7350/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerEntities.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerEntities.java b/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerEntities.java
index 4427de6..f13de6f 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerEntities.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerEntities.java
@@ -30,15 +30,20 @@ import com.hp.hpl.jena.sparql.core.QuadAction ;
import com.hp.hpl.jena.sparql.util.FmtUtils ;
// Currently unused
-// This would index multiple quads at a time from batched stream of chnages (e.g. rdf-patch)
+// This would index multiple quads at a time from batched stream of changes (e.g. rdf-patch)
public class TextDocProducerEntities extends DatasetChangesBatched implements TextDocProducer {
private static Logger log = LoggerFactory.getLogger(TextDocProducer.class) ;
private final EntityDefinition defn ;
private final TextIndex indexer ;
- // Also have to have a ThreadLocal here to keep track of whether or not we are in a transaction,
+ // Have to have a ThreadLocal here to keep track of whether or not we are in a transaction,
// therefore whether or not we have to do autocommit
- private final ThreadLocal<Boolean> inTransaction = new ThreadLocal<Boolean>() ;
+ private final ThreadLocal<Boolean> inTransaction = new ThreadLocal<Boolean>() {
+ @Override
+ protected Boolean initialValue() {
+ return Boolean.FALSE ;
+ }
+ } ;
public TextDocProducerEntities(TextIndex indexer) {
this.defn = indexer.getDocDef() ;
http://git-wip-us.apache.org/repos/asf/jena/blob/503a7350/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerTriples.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerTriples.java b/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerTriples.java
index 9ae029b..9fff673 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerTriples.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextDocProducerTriples.java
@@ -31,8 +31,13 @@ public class TextDocProducerTriples implements TextDocProducer {
// Also have to have a ThreadLocal here to keep track of whether or not we are in a transaction,
// therefore whether or not we have to do autocommit
- private final ThreadLocal<Boolean> inTransaction = new ThreadLocal<Boolean>() ;
-
+ private final ThreadLocal<Boolean> inTransaction = new ThreadLocal<Boolean>() {
+ @Override
+ protected Boolean initialValue() {
+ return Boolean.FALSE ;
+ }
+ } ;
+
public TextDocProducerTriples(TextIndex indexer) {
this.defn = indexer.getDocDef() ;
this.indexer = indexer ;