Is it possible to call a method that requires a transaction inside a method that does not support?
@TransactionAttribute(value = TransactionAttributeType.NEVER)
public void DoSomething(final List<Item> items) {
for (Item i : items) {
methodCall(item);
}
@TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
public void methodCall(final Item item) {
item.getSalesOrder();
item.getAllocation();
}
The .NEVER attribute says that it guarantees that the method is not executed inside the transaction, but as for calls to other methods inside this method.
source
share