[
https://issues.apache.org/jira/browse/JENA-1207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363138#comment-15363138
]
Andy Seaborne commented on JENA-1207:
-------------------------------------
Could we have a complete, minimal example please? And in what environment is
the code running?
I tried to recreate the situation based on the snippet above but everything I
have tried has worked fine.
One import thing is what is the datatype of statements?
> Adding Decimal Typed Literal Results in TDBException on Dataset Commit
> ----------------------------------------------------------------------
>
> Key: JENA-1207
> URL: https://issues.apache.org/jira/browse/JENA-1207
> Project: Apache Jena
> Issue Type: Bug
> Components: TDB
> Affects Versions: Jena 3.1.0
> Environment: Mac OSX
> Reporter: Kai He
>
> When adding a statement of the form
> [http://www.myhost.com/mysubject, http://www.myhost.com/mypredicate,
> "2.2"^^http://www.w3.org/2001/XMLSchema#decimal]
> using the following snippet
> {code:java}
> dataset.begin(ReadWrite.WRITE);
> try {
>
> Model model = dataset.getDefaultModel();
>
> // add statements
> model.add(statements);
> dataset.commit();
>
> } catch (Exception e) {
>
> success = false;
> e.printStackTrace();
> dataset.abort();
>
> } finally {
> dataset.end();
> }
> {code}
> A TDBException is thrown. The stack trace shows the following:
> {code:java}
> org.apache.jena.tdb.TDBException: Different ids for
> "1.2"^^http://www.w3.org/2001/XMLSchema#decimal: allocated: expected
> [00000000000005B7], got [020100000000000C]
> at
> org.apache.jena.tdb.transaction.NodeTableTrans.inconsistent(NodeTableTrans.java:232)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.NodeTableTrans.append(NodeTableTrans.java:220)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.NodeTableTrans.writeNodeJournal(NodeTableTrans.java:317)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.NodeTableTrans.commitPrepare(NodeTableTrans.java:289)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.Transaction.prepare(Transaction.java:172)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.Transaction.commit(Transaction.java:108)
> ~[jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.DatasetGraphTxn.commit(DatasetGraphTxn.java:54)
> [jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.tdb.transaction.DatasetGraphTransaction._commit(DatasetGraphTransaction.java:146)
> [jena-tdb-3.1.0.jar:3.1.0]
> at
> org.apache.jena.sparql.core.DatasetGraphTrackActive.commit(DatasetGraphTrackActive.java:46)
> [jena-arq-3.1.0.jar:3.1.0]
> at org.apache.jena.sparql.core.DatasetImpl.commit(DatasetImpl.java:123)
> [jena-arq-3.1.0.jar:3.1.0]
> {code}
> The problem goes away when adding statements with integer values like
> [http://www.myhost.com/mysubject, http://www.myhost.com/mypredicate,
> "2"^^http://www.w3.org/2001/XMLSchema#integer]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)