[This issue got demystified after offline discussion] What Haibo forgot to mention is that contexts were cleared in the same transaction that added the new statements. SwiftOWLIM got confused by clearing and then adding the same contexts in the same transaction (this is a bug which is now filed in our defect tracking system).
The workaround is to operate as follows: 1/ clear all contexts needed 2/ commit 3/ add all statements 4/ commit again Proceeding like this solves the problem. On Friday 18 December 2009 13:04:45 Bert Verslyppe wrote: > Dear Haibo, > > > Maybe you need to add > con.close(); > owlse2.shutDown(); > after the commit() statement? > > > Kind regards, > Bert > > On Thursday 17 December 2009 02:18:10 Haibo Liu wrote: > > ----- Forwarded Message ----- > > From: Haibo Liu <[email protected]> > > To: [email protected] > > Sent: Tue, 15 Dec 2009 15:26:06 -0500 (EST) > > Subject: RepositoryConnection.commit() > > > > I'm using Sesame2 version 2.2.4 and SwiftOWLIM ver3.0.beta9. The > > RepositoryConnection.setAutoCommit(false) seems to work. But the > > RepositoryConnection.commit() seems not. > > > > The code is like this: > > ... > > SailImpl owlimSail = new com.ontotext.trree.owlim_ext.SailImpl(); > > owlse2 = new SailRepository(owlimSail); > > RepositoryConnection con = owlse2.getConnection(); > > con.setAutoCommit(false); > > > > for (String importURL : importURLs) { > > > > try { > > > > inUrl = new URL(importURL); > > uriaddress = new URIImpl(importURL); > > > > log.info("Importing URL: " + inUrl); > > con.add(inUrl, importURL, RDFFormat.RDFXML, > > (Resource) uriaddress); > > log.info("Finished Importing URL: " + inUrl); > > > > }catch (Exception e){ > > log.error("Failed to import "+importURL+" Associated error > > message: "+e.getMessage()); > > con.rollback(); //something went wrong, roll it back. > > } > > > > } > > con.commit(); //finalize the transaction > > > > The above code leave the repository empty. However, if not using the > > RepositoryConnection.setAutoCommit(false) and > > RepositoryConnection.commit(). > > > > The repository is populated correctly. > > > > Did I miss something here? Does the SwiftOWLim support the delayed > > commit? > > > > Thanks, > > > > Haibo > > > > > > > > > > _______________________________________________ > > OWLIM-discussion mailing list > > [email protected] > > http://ontotext.com/mailman/listinfo/owlim-discussion > > _______________________________________________ > OWLIM-discussion mailing list > [email protected] > http://ontotext.com/mailman/listinfo/owlim-discussion _______________________________________________ OWLIM-discussion mailing list [email protected] http://ontotext.com/mailman/listinfo/owlim-discussion
