Skip to content

Commit

Permalink
Removed transaction support from CottontailConnection (for now).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Gasser committed Aug 12, 2024
1 parent 1c92397 commit f49679b
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,8 @@ class CottontailConnection(provider: CottontailConnectionProvider, schemaName: S
*/
@Synchronized
override fun <T> withTransaction(action: (Unit) -> T): T {
val transactionId = this.client.begin()
try {
val ret = action.invoke(Unit)
this.client.commit(transactionId)
return ret
} catch (e: Throwable) {
this.client.rollback(transactionId)
LOGGER.error(e) { "Failed to execute action in transaction due to erro.." }
throw e
}
LOGGER.warn { "Transactions are not supported by Cottontail DB. Ignoring transaction." }
return action.invoke(Unit)
}

/**
Expand Down

0 comments on commit f49679b

Please sign in to comment.