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