From 4c480912a88376b4a875206b2ebd994cef767e6a Mon Sep 17 00:00:00 2001 From: akwizgran <michael@briarproject.org> Date: Thu, 30 May 2013 17:35:32 +0100 Subject: [PATCH] Removed unnecessary calls to Connection.setAutoCommit(). We always use transactions so auto-commit can always be false. --- briar-core/src/net/sf/briar/db/JdbcDatabase.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/briar-core/src/net/sf/briar/db/JdbcDatabase.java b/briar-core/src/net/sf/briar/db/JdbcDatabase.java index 5ab537972d..41202a4c94 100644 --- a/briar-core/src/net/sf/briar/db/JdbcDatabase.java +++ b/briar-core/src/net/sf/briar/db/JdbcDatabase.java @@ -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); } -- GitLab