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:
parent
0644ce81dc
commit
d17bec5387
3 changed files with 9 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,6 @@ public interface IAdHocTransactionService {
|
|||
|
||||
public <T> T runOnAnotherTransaction(IOnTransaction<T> onTransaction);
|
||||
|
||||
public <T> T runOnAnotherReadOnlyTransaction(IOnTransaction<T> onTransaction);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue