[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-08-01 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565922#comment-16565922
 ] 

ASF GitHub Bot commented on JENA-1581:
--

GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/453

JENA-1581: TDB1 Node Buffer Mgt.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena tdb-buffer

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/453.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #453


commit 6ca79049a0429a6b3df531d275484905e4770d32
Author: Andy Seaborne 
Date:   2018-08-01T20:02:34Z

Add sync to _close().  Try out auto-strip trailing whitepace.

commit 8627e79deb4c58337e49be0e524e423b3789b102
Author: Andy Seaborne 
Date:   2018-08-01T20:15:41Z

JENA-1581: Don't use a global buffer.




> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
>Affects Versions: Jena 3.7.0, Jena 3.8.0
> Environment: Jena 3.8.0
>Reporter: Scott Patterson
>Assignee: Andy Seaborne
>Priority: Critical
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:151)
>  at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
>  at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-08-01 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565833#comment-16565833
 ] 

Andy Seaborne commented on JENA-1581:
-

Thanks for the details. Very helpful.

Given it is more one dataset being written at the same time, I can now see how 
it can go wrong. Your fix is good, having the call to {{encodeStore}} from 
{{NodeTableNative}} provide a workspace ByteBuffer, per dataset, is also 
possible.

TDB2 is not affected by this.

 

> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
>Affects Versions: Jena 3.8.0
> Environment: Jena 3.8
>Reporter: Scott Patterson
>Assignee: Andy Seaborne
>Priority: Critical
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:151)
>  at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
>  at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-08-01 Thread Scott Patterson (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565589#comment-16565589
 ] 

Scott Patterson commented on JENA-1581:
---

All accesses are inside transactions.

I'm not seeing any warnings from ds.close() but I'll keep an eye out for them.

I have 3 tdb datasets in different locations. All 3 are used in the same manner 
as above where there's only 1 writer thread per dataset but multiple readers.

> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
> Environment: Jena 3.8
>Reporter: Scott Patterson
>Priority: Major
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:151)
>  at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
>  at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-08-01 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565429#comment-16565429
 ] 

Andy Seaborne commented on JENA-1581:
-

If all accesses are inside transactions, then yes that's right.

There is no need to close the dataset at {{ds.close}} - do you get occasional 
warnings from this call?

Accessing the base dataset is a bad idea. There is no need to release the 
dataset before exit. In fact, there io no need to access {{StoreConnection}} - 
{{TDBFactory}} is enough.

There is no need to {{TDBFactory.createDataset}} each time if you want to keep 
it stored somewhere that's fine (internally, {{StoreConnection}} is used by 
{{TDBFactory}} and has a cache anyway).

{{NodeLib.encodeStore}} is only accessed in a single threaded fashion (see the 
comments for who locks it) because there is only one true writer at a time.

Do you have more than one dataset (by location) or possibly have different 
names for the same location?




> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
> Environment: Jena 3.8
>Reporter: Scott Patterson
>Priority: Major
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:151)
>  at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
>  at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-08-01 Thread Scott Patterson (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565378#comment-16565378
 ] 

Scott Patterson commented on JENA-1581:
---

I will try to put together a small example to reproduce this.

In the meantime I tested out a small change to 
org.apache.jena.tdb.lib.NodeLib.encodeStore() to always allocate a new buffer 
and the problem went away. Could this be a problem with NodeLib using a 
bytebuffer in a single threaded fashion?
{code:java}
//throw BufferOverflowException
final private static ByteBuffer workspace = ByteBuffer.allocate(SIZE);
public static long encodeStore(Node node, ObjectFile file) {
  int maxSize = nodec.maxSize(node);
  ByteBuffer bb = workspace;
  if ( maxSize >= SIZE )
// Large object. Special buffer.
bb = ByteBuffer.allocate(maxSize);
  else
bb.clear();
  int len = nodec.encode(node, bb, null);
  long x = file.write(bb);
  return x;
}

//no problem
public static long encodeStore(Node node, ObjectFile file) {
  int maxSize = nodec.maxSize(node);
  ByteBuffer bb = ByteBuffer.allocate(maxSize);
  int len = nodec.encode(node, bb, null);
  long x = file.write(bb);
  return x;
}
{code}
 

But that also made me wonder if my application is not using the api in a thread 
safe manner. 

Upon startup my application does:

 
{code:java}
String directory = "/path/to/tdb";
StoreConnection storeConn = StoreConnection.make(directory);
{code}
And during shutdown it does

 

 
{code:java}
storeConn.getBaseDataset().close();
StoreConnection.release(Location.create(directory));{code}
 

 

While the application is running I only create 1 writer thread at a time and it 
is using the TDB like this:

 
{code:java}
Dataset ds = TDBFactory.createDataset(directory);
try {
  ds.begin(ReadWrite.WRITE);
  try {
//add graphs
  } finally {
ds.end();
  }
} finally {
  ds.close();
}{code}
but the application may have at least two other reading threads using the TDB 
like this:

 

 
{code:java}
Dataset ds = TDBFactory.createDataset(directory);
try {
  ds.begin(ReadWrite.READ);
  try {
//
  } finally {
ds.end();
  }
} finally {
  ds.close();
}
{code}
 

Is this usage correct? I'm wondering if the reason the NodeLib is tripping up 
is because multiple threads are using the private static ByteBuffer.

 

> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
> Environment: Jena 3.8
>Reporter: Scott Patterson
>Priority: Major
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> 

[jira] [Commented] (JENA-1581) BufferOverflowException when

2018-07-31 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16564415#comment-16564415
 ] 

Andy Seaborne commented on JENA-1581:
-

[~spatterson] - would it be possible to provide a standalone example/test case 
that generates the situation you are encountering?  Thanks.

> BufferOverflowException when
> 
>
> Key: JENA-1581
> URL: https://issues.apache.org/jira/browse/JENA-1581
> Project: Apache Jena
>  Issue Type: Bug
>  Components: TDB
> Environment: Jena 3.8
>Reporter: Scott Patterson
>Priority: Major
>
> I can not add a small number of named graphs (~1000) to the TDB without 
> encountering a BufferOverflowException. I have a single thread that adds all 
> the graphs and I get lots of these exceptions with different named graphs 
> each time. Any thoughts?
> {noformat}
> Caused by: java.nio.BufferOverflowException
>  at java.nio.Buffer.nextPutIndex(Buffer.java:532)
>  at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
>  at org.apache.jena.atlas.io.BlockUTF8.fromCharsBuffer(BlockUTF8.java:172)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:86)
>  at org.apache.jena.atlas.io.BlockUTF8.fromChars(BlockUTF8.java:230)
>  at org.apache.jena.tdb.store.nodetable.NodecSSE.encode(NodecSSE.java:89)
>  at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:74)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:175)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:125)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:79)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:152)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getAllocateNodeId(NodeTableCache.java:91)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
>  at 
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
>  at 
> org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
>  at org.apache.jena.tdb.store.QuadTable.add(QuadTable.java:60)
>  at 
> org.apache.jena.tdb.store.DatasetGraphTDB.addToNamedGraph(DatasetGraphTDB.java:97)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.add(DatasetGraphTriplesQuads.java:44)
>  at org.apache.jena.sparql.core.GraphView.performAdd(GraphView.java:152)
>  at 
> org.apache.jena.graph.GraphUtil$$Lambda$145.20B643F0.accept(Unknown 
> Source)
>  at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:910)
>  at 
> org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:151)
>  at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
>  at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
>  at 
> org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)