From: <tho...@us...> - 2011-05-09 12:48:05
|
Revision: 4465 http://bigdata.svn.sourceforge.net/bigdata/?rev=4465&view=rev Author: thompsonbry Date: 2011-05-09 12:47:59 +0000 (Mon, 09 May 2011) Log Message: ----------- Bug fix to BigdataSailConnection for improper rollback of full transactions. The code was invoking super.rollback() which caused a database (Journal) level abort() in addition to peforming a transaction level abort. The journal level abort was causing updates against the unisolated lexicon indices to be lost and was breaking the eventually consistent contract for TERM2ID and ID2TERM. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2011-05-08 14:18:34 UTC (rev 4464) +++ branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2011-05-09 12:47:59 UTC (rev 4465) @@ -2286,7 +2286,7 @@ * Or perhaps this can be rolled into the {@link ValueFactory} impl * along with the reverse bnodes mapping? */ - private ConcurrentWeakValueCacheWithBatchedUpdates<IV, BigdataValue> termCache; + final private ConcurrentWeakValueCacheWithBatchedUpdates<IV, BigdataValue> termCache; /** * Factory used for {@link #termCache} for read-only views of the lexicon. @@ -2431,11 +2431,18 @@ * {@link BigdataValue} for that term identifier in the lexicon. */ final public BigdataValue getTerm(final IV iv) { - + +// if (false) { // alternative forces the standard code path. +// final Collection<IV> ivs = new LinkedList<IV>(); +// ivs.add(iv); +// final Map<IV, BigdataValue> values = getTerms(ivs); +// return values.get(iv); +// } + if (iv.isInline()) return iv.asValue(this); - TermId tid = (TermId) iv; + final TermId tid = (TermId) iv; // handle NULL, bnodes, statement identifiers, and the termCache. BigdataValue value = _getTermId(tid); @@ -2531,7 +2538,7 @@ * @return * the term identifier for the value */ - private TermId getTermId(Value value) { + private TermId getTermId(final Value value) { final IIndex ndx = getTerm2IdIndex(); Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2011-05-08 14:18:34 UTC (rev 4464) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2011-05-09 12:47:59 UTC (rev 4465) @@ -1582,7 +1582,15 @@ @Override public synchronized void rollback() throws SailException { - super.rollback(); + /* + * Note: DO NOT invoke super.rollback(). That will cause a + * database (Journal) level abort(). The Journal level abort() + * will discard the writes buffered on the unisolated indices + * (the lexicon indices). That will cause lost updates and break + * the eventually consistent design for the TERM2ID and ID2TERM + * indices. + */ +// super.rollback(); try { @@ -3498,7 +3506,7 @@ * native joins and the BigdataEvaluationStatistics rely on * this. */ - Object[] newVals = replaceValues(dataset, tupleExpr, bindings); + final Object[] newVals = replaceValues(dataset, tupleExpr, bindings); dataset = (Dataset) newVals[0]; bindings = (BindingSet) newVals[1]; @@ -3542,8 +3550,6 @@ } catch (QueryEvaluationException e) { -// log.error("Remove log stmt"+e,e);// FIXME remove this - I am just looking for the root cause of something in the SAIL. - throw new SailException(e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |