title: Spring @Transactional configuring xml
body: <p>The rollback in my transaction doesn't work (Spring 3.1). I tried to edit my configuration xml file, like <a href="http://docs.spring.io/autorepo/docs/spring/4.2.x/spring-framework-reference/html/transaction.html" rel="nofollow noreferrer">here</a> but without result.
  Here my xml file:</p>
  <pre><code>    &lt;beans xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
          xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot; 
          xmlns=&quot;http://www.springframework.org/schema/beans&quot;
          xmlns:jee=&quot;http://www.springframework.org/schema/jee&quot;
          xmlns:aop= &quot;http://www.springframework.org/schema/aop&quot;
          xmlns:tx= &quot;http://www.springframework.org/schema/tx&quot;
          xmlns:jpa=&quot;http://www.springframework.org/schema/data/jpa&quot;
          xsi:schemaLocation=&quot;
                  http://www.springframework.org/schema/mvc 
                  http://www.springframework.org/schema/mvc/spring-mvc.xsd 
                  http://www.springframework.org/schema/jee   
                  http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
                  http://www.springframework.org/schema/beans
                  http://www.springframework.org/schema/beans/spring-beans.xsd
                  http://www.springframework.org/schema/aop
                  http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
                  http://www.springframework.org/schema/tx
                  http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                  http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
                  &quot;&gt;
      
          &lt;jee:jndi-lookup id=&quot;dataSourceUsrAppe1&quot; jndi-name=&quot;jdbc/ZhabDS&quot;/&gt;
          
          &lt;bean id=&quot;utentiDAO&quot; class=&quot;it.dao.UtentiDAO&quot;&gt;
              &lt;property name=&quot;dataSourceUsrAppe1&quot;&gt;
                  &lt;ref bean=&quot;dataSourceUsrAppe1&quot;/&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  &lt;!--    doesn't work with this:
          &lt;tx:annotation-driven transaction-manager=&quot;txManager&quot;/&gt;
              &lt;property name=&quot;dataSourceUsrAppe1&quot;&gt;
                  &lt;ref bean=&quot;dataSourceUsrAppe1&quot;/&gt;
              &lt;/property&gt;
          &lt;/bean&gt;  
      &lt;/beans&gt;
  --&gt;
  &lt;/beans&gt;
  </code></pre>
  <p>Should I add a transaction manager here?</p>
  <p>Here's my service:</p>
  <pre><code>@Service
  public class UtentiService {
      @Autowired
      private UtentiDAO utentiDAO;
  
      @Transactional(rollbackFor={Exception.class}, propagation=Propagation.REQUIRED)
      public boolean createUser(Zhabuten user)  throws Exception
      {
              long idPrincipale;
              idPrincipale = utentiDAO.insert(user, utentiDAO.query1);
              idPrincipale = utentiDAO.insert(user, utentiDAO.query2);
  
              if (idPrincipale!=0) throw new java.lang.Exception();
  
              idPrincipale = utentiDAO.insert(user, utentiDAO.query3);
          return false;
      }
  }
  </code></pre>
  <p>The exception is correctly thrown, it's catched from the controller and the database is not rollbacked.
  Do I missing any configuration in the xml?</p>