mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 14:19:53 +01:00
Removed unnecessary calls to Connection.setAutoCommit().
We always use transactions so auto-commit can always be false.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user