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
