Unverified Commit 4b333383 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

commit transaction to db

parent 31e77694
Pipeline #22164 passed with stages
in 3 minutes and 45 seconds
......@@ -177,15 +177,34 @@ trait MariadbClient {
//noinspection ScalaStyle
def deleteMariaDBEntries(record: ProcessedRecord): ProcessedRecord = {
val digitalObjectId = record.recordId + "-1"
val updatedRecord = updateDigitalObjectResult(
record,
val digitalObjectDeletionResult =
deleteRows(digitalObjectId)
)
updateThumbnailResult(
updatedRecord,
deleteRows(s"$digitalObjectId-poster"),
val posterDeletionResult =
deleteRows(s"$digitalObjectId-poster")
val introDeletionResult =
deleteRows(s"$digitalObjectId-intro")
)
Try(connection.commit()) match {
case Success(_) =>
val updatedRecord = updateDigitalObjectResult(
record,
digitalObjectDeletionResult
)
updateThumbnailResult(
updatedRecord,
posterDeletionResult,
introDeletionResult
)
case Failure(ex) =>
val updatedRecord = updateDigitalObjectResult(
record,
Failure(ex)
)
updateThumbnailResult(
updatedRecord,
Failure(ex),
Failure(ex)
)
}
}
def checkDBConnection(timeout: Int): Unit = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment