title: JDBC - setAutoCommit for read only operation
body: <p>Let's say I have a common method which creates a DB connection:</p>
  
  <pre><code>Connection getConnection() throws SQLException {
      Connection con = ... // create the connection
      con.setAutoCommit(false);
      return con;
  }
  </code></pre>
  
  <p>I put the <code>setAutoCommit(false)</code> call here so that callers of this method never have to worry about setting it. However, is this a bad practice if the operation executed by the caller is only reading data? Is there any extra overhead?</p>
  
  <p>My personal opinion is that it's better to centralize the logic in one place, that way callers never have to set the auto commit and this avoids code redundancy. I just wanted to make sure it didn't incur any unnecessary overhead for a read only operation.</p>