title: Spring @Transactional not rollbacking a bean attribute
body: <p>Modification of bean attribute not rollbacked with spring @Transactional</p>
  
  <p><strong>TestController.java</strong></p>
  
  <pre><code>@RestController
  public class TestController {
  
      @Autowired
      private TestService testService;
      @Autowired
      private TestBean testBean;
  
      @RequestMapping(value = "/test")
      public String testTransaction() {
            try{
                testService.testTransaction();
            }catch(Exception e){
                System.out.println("After exception: " + testBean.getAttribute());
            }
            return "test"
      }
  }
  </code></pre>
  
  <p><strong>TestService.java</strong></p>
  
  <pre><code>@Service
  public class TestService {
  
      @Autowired
      private TestBean testBean;
  
       @Transactional(rollbackFor = Exception.class)
       public void testTransaction() {
            testBean.increment();
            System.out.println("Before exception: " + testBean.getAttribute());
            throw new UnexpectedRollbackException("unexpected exception");
       }
  }
  </code></pre>
  
  <p><strong>TestBean.java</strong></p>
  
  <pre><code>@Component
  public class TestBean {
  
       private int attribute = 0;
  
       public TestBean() {
       }
  
       public void increment () {
            attribute++;
       }
  
       public int getAttribute() {
            return attribute;
       }
  }
  </code></pre>
  
  <p><strong>Console Log</strong></p>
  
  <pre><code>Before exception: 1
  After exception: 1
  </code></pre>
  
  <p>I m wondering why the attribute value is not rollbacked to 0 (its initial value).</p>