Dear Bert,
Thanks for the suggestion.
Dear Haibo,
Maybe you need to add
con.close();
owlse2.shutDown();
after the commit() statement?
This gave the same result.
I wander if owlimSail needs special attention on this.
If I use sesame MemoryStore (instead of owlimSail), my code works well.
However, we need to use owlimSail.
The goal is to improve the performance (less time in updating the
repository). One way to achieve this goal is to reduce the time on
inferencing (which take a lot resource). My understanding is that after
each deleting/adding a statement in the reposiotory, the inferencing is
performed. If we add/delete a bunch of statement, the inferencing will
be done several times. We want to group the deleting/adding and just
perform one inferencing (update?) on the repository after a group of
adding/deleting action.
This is why I use the combination of
con.setAutoCommit(false)
and
con.commit();
to delay the commit.
Any advice on this issue is really appreciated!
Thanks,
Haibo
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