public void updateDataset(EntityManager manager, BusinessTransaction transaction, JbsUser changeUser) throws EJbsObject {
if (logger.isDebugEnabled()) {
logger.debug("Updating transaction " + transaction.getId());
logger.debug("Looking for existing transaction " + transaction.getId());
}
BusinessTransaction existingTransaction = manager.find(BusinessTransaction.class, transaction.getId());
if (logger.isDebugEnabled()) {
logger.debug("Position-Count: " + existingTransaction.getPositions().size());
logger.debug("Deleting positions that no longer exist.");
}
this.deleteOldPositions(manager, transaction, existingTransaction.getPositions());
if (transaction.getPositions() != null) {
if (logger.isDebugEnabled()) {
logger.debug("Setting sort-indexes.");
}
this.setSortIndexes(transaction.getPositions());