Skip to content
rfreier edited this page Apr 13, 2018 · 1 revision
Table of Contents

Transaction Handling

Transactions are technically processed by the data access layer. However, the transaction control has to be performed in upper layers. To avoid dependencies on persistence layer and technical code in upper layers, we use AOP to add transaction control via annotations as aspect.

As we recommend using spring, we use the @Transactional annotation (for a JEE application server you would use @TransactionAttribute instead). We use this annotation in the logic layer to annotate business methods that participate in transactions (what typically applies to all business components).

@Transactional
public class MyExampleLogicImpl {
  public MyDataTo getData(MyCriteriaTo criteria) {
    ...
  }
  ...
}

Batches

Transaction control for batches is a lot more complicated and is described in the batch layer.

Clone this wiki locally