[
https://issues.apache.org/jira/browse/JENA-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Seaborne resolved JENA-263.
--------------------------------
Resolution: Not A Problem
The problem is that you are getting the model reference outside the first
transaction. Such a model reference is attached to the non-transactional view
of the data.
This will change - there is prototype code for "view graphs" which are a
general way of having models over DatasetGraphs and will work over the
DatasetGraphTransaction that flips across transactions.
But currently, TDB graphs are hardwired access to the underlying database so
become directly attached to the transaction DatasetGraphTxn (one time internal
object) or base storage (if before the first transaction begin).
Put the ds.getDefaultModel/ds.getNamedModel inside the begin/commit.
ds.begin(ReadWrite.WRITE);
Model m = ds.getNamedModel(....)
There will also currently be problems if the app carries model out of the
transaction:
e.g.
ds.begin(ReadWrite.READ);
Model m = ds.getDefaultModel() ;
ds.end() ;
causes a later:
Exception in thread "main" com.hp.hpl.jena.tdb.TDBException: Allocation attempt
on NodeTableReadonly
which suggestively matches the name of your test.
> Adding resource property inside TDB transaction causes message '*******
> UNEXPECTED'
> -----------------------------------------------------------------------------------
>
> Key: JENA-263
> URL: https://issues.apache.org/jira/browse/JENA-263
> Project: Apache Jena
> Issue Type: Bug
> Components: TDB
> Affects Versions: TDB 0.9.1
> Reporter: Ian Dickinson
> Assignee: Andy Seaborne
> Labels: tdb
> Attachments: TdbTxText.java
>
>
> I created the attached test case while trying to isolate a problem I was
> seeing in some other code. This code doesn't repro the exception I'm seeing,
> but I do get the output '**************** UNEXPECTED' on stderr. Test case
> attached.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira