* @return
*/
@Override
public RepositoryResult<Version> listVersions(Resource r, Date from, Date to) throws SailException {
try {
final KiWiVersioningConnection connection = persistence.getConnection();
KiWiResource kr = (KiWiResource) ((r instanceof URI) ? getValueFactory().createURI(r.stringValue()) : getValueFactory().createBNode(r.stringValue()));
return new RepositoryResult<Version>(connection.listVersions(kr,from,to)) {
@Override
protected void handleClose() throws RepositoryException {
super.handleClose();
try {
connection.commit();
connection.close();
} catch (SQLException ex) {
throw new RepositoryException("database error while committing/closing connection");
}
}
};