session.getTransaction().commit();
} catch (Exception ex) {
log.error("", ex);
rollback(session);
throw new StoreInternalException(ex, "Cannot access database.");
}
// run XRD through the CREATE pipeline
XRD newXRD;
try {
if (createPipeline != null) {
newXRD = createPipeline.execute(this, xrd, null, null, null, authority, true);
} else {
newXRD = xrd;
}
} catch (Exception ex) {
log.error("", ex);
rollback(session);
throw new StoreInternalException(ex, "Cannot execute pipeline.");
}
// start database session
session = this.getSessionFactory().getCurrentSession();
// set XRD
try {
session.beginTransaction();
reattach(session, authority);
authority.setXrd(newXRD);
session.update(authority);
session.flush();
session.getTransaction().commit();
} catch (Exception ex) {
log.error("", ex);
rollback(session);
throw new StoreInternalException(ex, "Cannot access database.");
}
// done
log.trace("Done.");