org.apache.jena.shared.JenaException: virtuoso.jdbc4.VirtuosoException: SR197: Non unique primary key on DB.DBA.SYS_XML_PERSISTENT_NS_DECL

I am trying to upload large ttl files to virtuoso graphs using jena , the files are quite large(around 1GB) and a lot in number(187 different files per graph). Sometimes i face this issue where the uploading fails giving an error "SR197: Non unique primary key on DB.DBA.SYS_XML_PERSISTENT_NS_DECL. "
This error doesn’t appear sometimes and i am quite confused why only sometimes, i tried to see which exact file while being uploaded causes this issue but it turns out it happens at random files so basically its not because of one corrupted file. I am uploading the files in a parallel fashion using the code mentioned below

"public void rdfUploadMethod(VirtGraph graph, String fileName, List types) throws IOException {
Lang fileType = null;
if (types.contains(TTL_FILE_TYPE))
fileType = RDFLanguages.TTL;
else if (types.contains(XML_FILE_TYPE) || types.contains(RDF_FILE_TYPE))
fileType = RDFLanguages.RDFXML;
log.logInformation(“TripleStoreLoaderService”, “LoadRDFFileToGraph”, "Loading the graph " + graph.getGraphName() + " with file " + fileName);
VirtModel model = new VirtModel(graph);
StreamRDF writer = model.getStreamRDF(true, virtuosoChunkSize, new VirtuosoDeadLockHandler(0));
try (InputStream in = new FileInputStream(fileName)) {
RDFParser parser = RDFParser.create()
.lang(fileType) //.lang(RDFLanguages.N3)
.errorHandler(ErrorHandlerFactory.errorHandlerWarn) //.errorHandler(ErrorHandlerFactory.errorHandlerStrict)
catch(Exception e)
log.logError(“TripleStoreLoaderService”, “LoadRDFFileToGraph”,"FileName : " + fileName + " Message : " + e.getMessage());
throw e;
log.logInformation(“TripleStoreLoaderService”, “LoadRDFFileToGraph”, "Loaded the graph " + graph.getGraphName() + " with file " + fileName);

The method shown above rdfUploadMethod is being called in a parallel fashion to insert multiple files at a time.
So basically sometimes i am able to upload all the files with no error and sometimes this issue pops up stopping the upload in between.Can anyone help me identify the issue and guide me how to resolve it.

I am using virtuoso open source 7.2.7, apache-jena-libs - 4.6.1 , virtjdbc4- 3.122, virt_jena_v4_4 - 1.42

Have you reviewed the Virtuoso Jena RDFLoader git sample program, showing how large volumes of dataset files can be transactionally loaded into Virtuoso ?

yeah i did took a look at it before, but what exactly are you trying to mention here can you be more specific?

I was seeking clarification of whether you had reviewed the Jena RDFLoader sample git code, as it covers the loading of such large files in Jena and how issues around transaction concurrency, isolation level etc should be handled to prevent issues when uploading large files.

How much data in terms of number of triples does the indicated 187 1GB dataset files equate to ?

Are any errors being reported in the virtuoso.log file at the time the errors in the client side occur ? Also, what does the output of running the status()'; command in the isql command line tool report ?