Removed unnecessary calls to Connection.setAutoCommit().

We always use transactions so auto-commit can always be false.
This commit is contained in:
akwizgran
2013-05-30 17:35:32 +01:00
parent 91dba5f6f2
commit 4c480912a8

View File

@@ -474,11 +474,11 @@ abstract class JdbcDatabase implements Database<Connection> {
// Open a new connection // Open a new connection
txn = createConnection(); txn = createConnection();
if(txn == null) throw new DbException(); if(txn == null) throw new DbException();
txn.setAutoCommit(false);
synchronized(connections) { synchronized(connections) {
openConnections++; openConnections++;
} }
} }
txn.setAutoCommit(false);
} catch(SQLException e) { } catch(SQLException e) {
throw new DbException(e); throw new DbException(e);
} }
@@ -488,7 +488,6 @@ abstract class JdbcDatabase implements Database<Connection> {
public void abortTransaction(Connection txn) { public void abortTransaction(Connection txn) {
try { try {
txn.rollback(); txn.rollback();
txn.setAutoCommit(true);
synchronized(connections) { synchronized(connections) {
connections.add(txn); connections.add(txn);
connections.notifyAll(); connections.notifyAll();
@@ -512,7 +511,6 @@ abstract class JdbcDatabase implements Database<Connection> {
public void commitTransaction(Connection txn) throws DbException { public void commitTransaction(Connection txn) throws DbException {
try { try {
txn.commit(); txn.commit();
txn.setAutoCommit(true);
} catch(SQLException e) { } catch(SQLException e) {
throw new DbException(e); throw new DbException(e);
} }