Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
reload entity within async task to avoid lazy initialization exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Nov 15, 2013
1 parent dcab905 commit e426781
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Expand Up @@ -76,9 +76,8 @@ public void execute() {
task.getHandle().set(returnValue);
} catch (Exception t) {
task.getHandle().setException(t);
AsynchronousTaskExecutor.log
.debug("Exception when executing an asynchronous task.",
t);
log.error(
"Exception when executing an asynchronous task.", t);
}
}

Expand Down
Expand Up @@ -307,12 +307,12 @@ private void signalPostTranslateEvent(HTextFlowTarget hTextFlowTarget) {

Events.instance()
.raiseTransactionSuccessEvent(
TextFlowTargetStateEvent.EVENT_NAME,
new TextFlowTargetStateEvent(document.getId(),
textFlow.getId(), hTextFlowTarget
.getLocale().getLocaleId(),
hTextFlowTarget.getId(), hTextFlowTarget
.getState()));
TextFlowTargetStateEvent.EVENT_NAME,
new TextFlowTargetStateEvent(document.getId(),
textFlow.getId(), hTextFlowTarget
.getLocale().getLocaleId(),
hTextFlowTarget.getId(), hTextFlowTarget
.getState()));
}
}

Expand Down Expand Up @@ -656,10 +656,14 @@ protected Boolean work() throws Exception {
"skipping TextFlowTarget {} with unknown sourceHash: {}",
resId, sourceHash);
} else {
HProjectIteration iterationReloaded =
projectIterationDAO
.findById(hProjectIteration
.getId());
String validationMessage =
validateTranslations(
incomingTarget.getState(),
hProjectIteration,
iterationReloaded,
incomingTarget.getResId(),
textFlow.getContents(),
incomingTarget.getContents());
Expand Down

0 comments on commit e426781

Please sign in to comment.