use of fr.lirmm.graphik.graal.api.core.AtomSetException in project graal by graphik-team.
the class Neo4jStore method getTerms.
@Override
@Deprecated
public Set<Term> getTerms(Type type) throws AtomSetException {
TreeSet<Term> set = new TreeSet<Term>();
CloseableIterator<Term> it = this.termsIterator(type);
try {
while (it.hasNext()) {
set.add(it.next());
}
} catch (IteratorException e) {
throw new AtomSetException("An errors occurs while iterating terms", e);
}
return set;
}
use of fr.lirmm.graphik.graal.api.core.AtomSetException in project graal by graphik-team.
the class Neo4jStore method addAll.
@Override
public boolean addAll(CloseableIterator<? extends Atom> it) throws AtomSetException {
boolean isChanged = false;
this.checkTransaction();
try {
while (it.hasNext()) {
isChanged = this.add(it.next(), null) || isChanged;
}
this.successTransaction();
} catch (IteratorException e) {
throw new AtomSetException("An errors occurs while iterating atoms to add", e);
} finally {
this.reloadTransaction();
}
return isChanged;
}
use of fr.lirmm.graphik.graal.api.core.AtomSetException in project graal by graphik-team.
the class AbstractRdbmsBatchProcessor method commit.
@Override
public void commit() throws AtomSetException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("batch commit");
}
if (this.statement != null) {
try {
this.flush();
this.connection.commit();
} catch (Exception e) {
throw new AtomSetException(e);
}
}
}
use of fr.lirmm.graphik.graal.api.core.AtomSetException in project graal by graphik-team.
the class AbstractRdbmsStore method clear.
@Override
public void clear() throws AtomSetException {
CloseableIterator<Predicate> it = this.predicatesIterator();
Statement stat = null;
try {
try {
stat = this.createStatement();
while (it.hasNext()) {
Predicate p = it.next();
this.removePredicate(stat, p);
}
this.getConnection().commit();
} catch (IteratorException e) {
this.getConnection().rollback();
throw new AtomSetException(e);
} catch (SQLException e) {
this.getConnection().rollback();
throw new AtomSetException(e);
} finally {
if (stat != null)
stat.close();
}
} catch (SQLException e) {
throw new AtomSetException(e);
}
}
use of fr.lirmm.graphik.graal.api.core.AtomSetException in project graal by graphik-team.
the class AbstractRdbmsStore method removePredicate.
protected void removePredicate(Statement stat, Predicate p) throws AtomSetException {
try {
DBTable table = this.getPredicateTable(p);
String query = String.format("DROP TABLE %s", table.getName());
stat.execute(query);
this.predicateMap.remove(p);
} catch (SQLException e) {
throw new AtomSetException(e);
}
}
Aggregations