ItEr45S19CUTraspasoDeResponsabilidadesTraballoEntreUnidadesPlanificacion: Run buildResourcesText on another transaction.

This avoids composability problems since getResourcesText could be
executed within another transaction and the reattach would fail.
This commit is contained in:
Óscar González Fernández 2010-02-02 14:06:55 +01:00
parent 0644ce81dc
commit d17bec5387
3 changed files with 9 additions and 1 deletions

View file

@ -122,4 +122,10 @@ public class AdHocTransactionService implements IAdHocTransactionService {
return onTransaction.execute();
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
public <T> T runOnAnotherReadOnlyTransaction(IOnTransaction<T> onTransaction) {
return onTransaction.execute();
}
}

View file

@ -29,4 +29,6 @@ public interface IAdHocTransactionService {
public <T> T runOnAnotherTransaction(IOnTransaction<T> onTransaction);
public <T> T runOnAnotherReadOnlyTransaction(IOnTransaction<T> onTransaction);
}

View file

@ -361,7 +361,7 @@ public class TaskElementAdapter implements ITaskElementAdapter {
public String getResourcesText() {
try {
return transactionService
.runOnReadOnlyTransaction(new IOnTransaction<String>() {
.runOnAnotherReadOnlyTransaction(new IOnTransaction<String>() {
@Override
public String execute() {