use of ubic.gemma.model.analysis.expression.coexpression.SupportDetails in project Gemma by PavlidisLab.
the class CoexpressionDaoImpl method updateModifiedSupportDetails.
// Possible external use
@SuppressWarnings({ "unused", "WeakerAccess" })
public void updateModifiedSupportDetails(BioAssaySet experiment, Collection<SupportDetails> supportDetailsToDelete, Collection<SupportDetails> supportDetailsToUpdate) {
int count;
int BATCH_SIZE = 1024;
Session sess = this.getSessionFactory().getCurrentSession();
/*
* no cascade, so we have to make sure these get updated.
*/
count = 0;
for (SupportDetails sd : supportDetailsToUpdate) {
sess.update(sd);
if (++count % 10000 == 0) {
CoexpressionDaoImpl.log.info("Updated " + count + " support details relevant to " + experiment + "...");
}
if (count % BATCH_SIZE == 0) {
sess.flush();
sess.clear();
}
}
CoexpressionDaoImpl.log.info("Updated " + count + " support details relevant to " + experiment + "...");
sess.flush();
sess.clear();
count = 0;
for (SupportDetails sd : supportDetailsToDelete) {
sess.delete(sd);
if (++count % 10000 == 0) {
CoexpressionDaoImpl.log.info("Removed support details for " + count + " links for " + experiment + "...");
}
if (count % BATCH_SIZE == 0) {
sess.flush();
sess.clear();
}
}
// finish deletes of the sd (this is not really necessary here, but trying to be consistent)
sess.flush();
sess.clear();
}
Aggregations