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