title: how can I rollback with spring jdbctemplate
body: <p>This is my dao layer:</p>
  
  <pre><code>public class UserDAOImpl extends BaseDAO implements UserDAO {
  
          private PlatformTransactionManager transactionManager;
  
          public void setTransactionManager(PlatformTransactionManager transactionManager) {
              this.transactionManager = transactionManager;
          }
  
          @Override
          public int storeSignUp(final StoreSignUp store) throws POSException {
              KeyHolder keyHolder = new GeneratedKeyHolder();
              TransactionDefinition def = new DefaultTransactionDefinition();
              TransactionStatus status = transactionManager.getTransaction(def);
              int id = 0;
              try {
                  this.jdbcTemplate.update(new PreparedStatementCreator() {
                      public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
                          PreparedStatement ps = connection.prepareStatement(INSERT_STORE, Statement.RETURN_GENERATED_KEYS);
                          ps.setString(1, store.getName());
                          ps.setString(2, store.getZip());
                          ps.setString(3, store.getCity());
                          ps.setString(4, store.getState());
                          ps.setInt(5, store.getCountryCode());
                          ps.setString(6, store.getAddress());
                          return ps;
                      }
  
                  }, keyHolder);
  
                  store.setId(keyHolder.getKey().intValue());
                  id = store.getId();
  
                  this.jdbcTemplate.update(INSERT_STORE_PHONE,
                          new Object[] { store.getId(), store.getPhone(), store.getPassword(), store.getSalt() });
                  transactionManager.commit(status);
              } catch (DuplicateKeyException e) {
                  transactionManager.rollback(status);
              }
              return id;
          }
      }
  </code></pre>
  
  <p>This is my application.xml</p>
  
  <pre><code>&lt;!-- Initialization for TransactionManager --&gt;
      &lt;bean id="transactionManager"
          class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>java.lang.NullPointerException
  `com.data.dao.UserDAOImpl.storeSignUp(UserDAOImpl.java:91)`
  </code></pre>
  
  <p>When i call this method tha data insert into one table but not in
  another table so i want to be rollback from first table.</p>