Small correction to stack trace from previous email, in case that matters:
Thread [qtp975404820-93] (Suspended (breakpoint at line 305 in
BlockMgrJournal))
owns: NodeTableNative (id=586)
owns: DatasetPrefixesTDB (id=587)
BlockMgrJournal.checkActive() line: 305
BlockMgrJournal._promote(Block) line: 220
BlockMgrJournal.promote(Block) line: 215
BPTreeRecordsMgr(PageBlockMgr<T>).promote(Page) line: 109
BPTreeRecords.promote() line: 118
BPTreeRecords.internalInsert(Record) line: 129
BPTreeNode.internalInsert(Record) line: 462
BPTreeNode.insert(BPTreeNode, Record) line: 206
BPlusTree.addAndReturnOld(Record) line: 323
BPlusTree.add(Record) line: 315
NodeTableNative.accessIndex(Node, boolean) line: 154
NodeTableNative._idForNode(Node, boolean) line: 120
NodeTableNative.getAllocateNodeId(Node) line: 76
NodeTableInline(NodeTableWrapper).getAllocateNodeId(Node) line: 39
NodeTableInline.getAllocateNodeId(Node) line: 50
NodeTupleTableConcrete.addRow(Node...) line: 85
DatasetPrefixesTDB.insertPrefix(String, String, String) line: 52
GraphPrefixesProjection.add(String, String) line: 63
PrefixMappingAdapter.add(String, String) line: 50
PrefixMappingAdapter(PrefixMappingBase).setNsPrefix(String, String)
line: 124
PrefixMappingTxn.lambda$0(String, String) line: 35
2012881121.run() line: not available
TxnX.exec(T, TxnType, Runnable) line: 156
TxnX.executeWrite(T, Runnable) line: 204
PrefixMappingTxn.setNsPrefix(String, String) line: 35
ModelCom.setNsPrefix(String, String) line: 965
On 2021-09-07 12:44 pm, Holger Knublauch wrote:
Hi Andy,
with our current migration to Jena 4.1 we noticed this change
https://issues.apache.org/jira/browse/JENA-2006
is affecting the way that we use TDB (in the "shared TDB aka XDB") mode.
Previously, all named graphs were storing their own prefixes, yet now
there seems to be only one prefix mapping for all named graphs, which
breaks the assumptions that we made on the Graph API until now.
We need to find a way to restore the old behavior. I drilled into the
code for a few hours but feel stuck due to my limited understanding of
how these pieces work together. So far I have introduced this class
below to override the createPrefixMapping method:
public class GraphXDB extends GraphTxnTDB {
public GraphXDB(DatasetGraphTransaction dataset, Node graphName) {
super(dataset, graphName);
}
@Override
protected PrefixMapping createPrefixMapping() {
DatasetPrefixesTDB pm =
getDatasetGraphTDB().getStoragePrefixes();
GraphPrefixesProjection projection = new
GraphPrefixesProjection(getGraphName().toString(), pm);
return Prefixes.adapt(projection);
}
}
and this looks OK in read mode but fails on writes with errors such as:
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] Not active: 20
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] **** Not active: 20
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] Not active: 20
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] **** Not active: 20
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] Not active: 20
ERROR o.a.j.t.t.BlockMgrJournal [qtp975404820-67] **** Not active: 20
Stack:
Thread [qtp975404820-101] (Suspended (breakpoint at line 304 in
BlockMgrJournal))
owns: Transaction (id=366)
BlockMgrJournal.checkActive() line: 304
BlockMgrJournal.commitPrepare(Transaction) line: 91
Transaction.lambda$prepare$0(TransactionLifecycle) line: 289
74738525.accept(Object) line: not available
ArrayList<E>.forEach(Consumer<? super E>) line: 1541
Transaction.forAllComponents(Consumer<TransactionLifecycle>) line: 283
Transaction.prepare() line: 289
Transaction.writerPrepareCommit() line: 165
Transaction.commit() line: 120
DatasetGraphTxn.commit() line: 61
DatasetGraphTransaction.commit() line: 216
DatasetGraphTxnTracking(DatasetGraphWrapper).commit() line: 276
DatasetGraphTxnTracking.commit() line: 41
TxnX.exec(T, TxnType, Runnable) line: 164
TxnX.executeWrite(T, Runnable) line: 204
PrefixMappingTxn.removeNsPrefix(String) line: 41
ModelCom.removeNsPrefix(String) line: 972
Would you have any hints on how to proceed and whether this is on the
right track? In the worst case, I guess we could switch to a
completely different storage mechanism for those per-graph prefixes
and bypass TDB.
Thank you
Holger