session.getTransaction().commit();
} catch (Exception ex) {
log.error("", ex);
rollback(session);
throw new StoreInternalException(ex, "Cannot access database.");
}
// build result list
SubSegment[] result = new ArrayList<SubSegment> (subSegments).toArray(new SubSegment[subSegments.size()]);