Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>An annotation is the best choice for marking that a method should be executed in a transaction. This is recommended for both Spring and EJB 3.</p> <p>The XML approach requires much more configuration, isn't refactor friendly and you have to see in the configuration if a certain method will be executed in a transaction or not.</p> <p>Since annotation based transaction support is the preferred choice by most developers and you don't like to use Spring's <code>@Transactional</code> annotation, I will recommend you to use a custom annotation.</p> <p>Then you have two choices:</p> <ul> <li>Let your custom annotation extend Spring's <code>@Transactional</code> and use the <code>&lt;tx:annotation-driven /&gt;</code> element in your Spring configuration. This is easy and only one annotation needs to be updated to remove the Spring dependency.</li> <li>Create an interceptor that executes logic before and after the annotated method. With Spring as the container, you should delegate the transaction handling from the interceptor's before and after advises to your preferred <code>PlatformTransactionManager</code> implementation.</li> </ul> <p>I have written about how you can create an interceptor that adds logic before and after a method marked with an annotation <a href="http://blog.espenberntsen.net/2010/04/01/declaratively-add-enterprise-functionality/#transaction-handling-with-aspect" rel="nofollow noreferrer">here</a>. And demonstrated which methods you must use on the PlatformTransactionManager <a href="http://blog.espenberntsen.net/2010/04/01/declaratively-add-enterprise-functionality/#transaction-handling-with-spring" rel="nofollow noreferrer">here</a>.</p> <p>I hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload