We normally annotate action methods of controller classes with @Transactional if we are accessing Persistence Objects of JPA, or EBean. The question is when to use @Transactional annotation and when to use JPA.withTransaction() (assuming we are using JPA for persistence).
What is the difference between these two, and which one is better?
We normally annotate action methods of controller classes with @Transactional if we are accessing
Share
You can use JPA.withTransaction for a block, @Transactional is for method or an action.