title: How to set autocommit value to false in Oracle Data Source connection?
body: <p>Inserting values in Oracle 11g via JdbcTemplate-OracleDataSource injected via Spring config file. 
  Transactions are done via @Transactional managed by DataSourceTransactionManager.</p>
  
  <p>Question 1) How to set the autocommit value to false? Default value is true, I guess.
  Following is the code snippet :</p>
  
  <pre><code>    DataSource ds = (DataSource)ctx.getBean("dataSourceBean");
      try {
          ds.getConnection().setAutoCommit(false);
          System.out.println("Autocommit " +ds.getConnection().getAutoCommit());
      } catch (SQLException e) {          
          e.printStackTrace();
      }
  </code></pre>
  
  <p>The <code>println</code> statement is giving <code>true</code> only.</p>
  
  <p>Also printed the getAutoCommit value in insert method of the DAO class. There also is coming as true.</p>
  
  <p>Question2) For unique constraint violation, I need to rollback.
  In that case, <code>DuplicateKeyException</code> is thrown which is wrapped over SQLIntegrityConstraintViolationException.
  So 
  @Transactional(rollbackFor = ?.class) must have which Exception?</p>