title: Oracle exception on commit for batch
body: <p>I have a function that basically opens a DB connection, alters the autocommit to false, runs a batch update, resets the autocommit to the original value, and then closes the DB connection.</p>
  
  <p>When I run the con.close() I am getting this...</p>
  
  <pre><code>java.lang.NoClassDefFoundError: oracle/jdbc/OracleConnection$CommitOption
          at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:2383) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
          at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:2407) ~[ojdbc7-12.1.0.jar:12.1.0.2.0]
          at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.commit(DelegatingConnection.java:373) ~[tomcat-dbcp.jar:8.5.11]
          at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.commit(DelegatingConnection.java:373) ~[tomcat-dbcp.jar:8.5.11]
  </code></pre>
  
  <p>And ojdbc7-12.1.0.jar is in my WEB-INF/lib</p>
  
  <p>This is my sample code (edited for some more context)</p>
  
  <pre><code>Connection con = DBConnection.openDBConnection(env);
  if (null == con) {
      return false;
  }
  PreparedStatement ps = null;
  
  try {
      ps = con.prepareStatement(query);
  
      for (ProcItem proc : listitems)  {
          ps.setString(1, junk);
          ps.addBatch();
      }
  } catch (SQLException e) {
      logger.error("Failed to create process insert batch");
      e.printStackTrace();
      success = false;
  }
  
  logger.trace("Finished creating batch update");
  
  try {
      boolean ac = con.getAutoCommit();
      con.setAutoCommit(false);
      ps.executeBatch();
      con.commit();                     // this is the line throwing the exception
      con.setAutoCommit(ac);
      logger.trace("Finished running batch update");
  } catch (SQLException e) {
      logger.error("Failed to execute process insert batch");
      e.printStackTrace();
      success = false;
  } finally {
      try { if (null != ps) { ps.close(); } } catch (SQLException e) {}
      con.close();
  }
  </code></pre>