- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
try {
eventTask = AliasHelper.getAliasValue(normalSession, AliasHelper.GENERAL_ALIAS_SET, AliasHelper.MSG_NEW_RESOLUTION);
ismNS.beginTransaction(); //Начать обе транзакции
ismSS.beginTransaction();
for (Iterator iter = targetUserNames.iterator(); iter.hasNext(); ) {
MailSender.UserData userData = (MailSender.UserData) iter.next();
IDfId queueId = getMainDocument().queue(userData.getUserName(), eventTask, 1, false, null, "Отправьте копию генеральному директору.");
IDfQueueItem queue = (IDfQueueItem) superSession.getObject(queueId);
queue.setString("task_subject", queueMessage);
queue.save();
}
} catch (Exception e) {
ismNS.setTransactionRollbackOnly();//Откатить изменения обеих транзакций
ismSS.setTransactionRollbackOnly();
throw new TTGWrapperException(e);
} finally {
try {
ismNS.commitTransaction();
ismSS.commitTransaction();
} catch (DfException e) {
throw new TTGWrapperException(e);
} finally {
ismSS.release(superSession);
}
}
someone 03.11.2015 11:28 # +2