diff --git a/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/Database.kt b/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/Database.kt index c02284f46eafe00c74f48c6b0a7da63addfdf5ac..56e1dd9fa81c6d384e4b8a7a9a5440dfeca440c7 100644 --- a/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/Database.kt +++ b/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/Database.kt @@ -2,7 +2,6 @@ package org.briarproject.mailbox.core.db import org.briarproject.mailbox.core.api.Contact import org.briarproject.mailbox.core.settings.Settings -import java.sql.Connection interface Database : TransactionManager { @@ -18,19 +17,6 @@ interface Database : TransactionManager { @Throws(DbException::class) fun close() - /** - * Aborts the given transaction - no changes made during the transaction - * will be applied to the database. - */ - fun abortTransaction(connection: Connection) - - /** - * Commits the given transaction - all changes made during the transaction - * will be applied to the database. - */ - @Throws(DbException::class) - fun commitTransaction(connection: Connection) - @Throws(DbException::class) fun getSettings(txn: Transaction, namespace: String): Settings diff --git a/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/JdbcDatabase.kt b/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/JdbcDatabase.kt index 4639361c4b694fdb096d5c3d3c7e4118bd8ad7b7..79fafc22b5f2ec588ad3a84d6b9eed1424dcb651 100644 --- a/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/JdbcDatabase.kt +++ b/mailbox-core/src/main/java/org/briarproject/mailbox/core/db/JdbcDatabase.kt @@ -219,7 +219,7 @@ abstract class JdbcDatabase(private val dbTypes: DatabaseTypes, private val cloc return connection } - override fun abortTransaction(connection: Connection) { + private fun abortTransaction(connection: Connection) { try { connection.rollback() connectionsLock.lock() @@ -244,7 +244,7 @@ abstract class JdbcDatabase(private val dbTypes: DatabaseTypes, private val cloc } } - override fun commitTransaction(connection: Connection) { + private fun commitTransaction(connection: Connection) { try { connection.commit() } catch (e: SQLException) {