Skip to content
Snippets Groups Projects
Commit 26c8d6f9 authored by Sebastian's avatar Sebastian
Browse files

Remove some methods from Database and make them internal to implementation

parent bc211601
No related branches found
No related tags found
1 merge request!20Remove DatabaseComponent and use Database directly
......@@ -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
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment