From 8a93483c3e689301e4a3b503cc1a14947647607d Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Fri, 5 Apr 2019 16:43:53 +0200
Subject: [PATCH] Fixed failure to commit the tape's fSeq update when reporting
 only placeholders.

---
 catalogue/OracleCatalogue.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/catalogue/OracleCatalogue.cpp b/catalogue/OracleCatalogue.cpp
index 687d8f53ee..76f8fb9e3b 100644
--- a/catalogue/OracleCatalogue.cpp
+++ b/catalogue/OracleCatalogue.cpp
@@ -377,8 +377,11 @@ void OracleCatalogue::filesWrittenToTape(const std::set<TapeItemWrittenPointer>
     const TapeItemWritten &lastEvent = **lastEventItor;
     updateTape(conn, lastEvent.vid, lastEvent.fSeq, totalCompressedBytesWritten, lastEvent.tapeDrive);
 
-    // If we had only placeholders and no file recorded, we are done.
-    if (fileEvents.empty()) return;
+    // If we had only placeholders and no file recorded, we are done (but we still commit the update of the tape's fSeq).
+    if (fileEvents.empty()) {
+      conn.commit();
+      return;
+    }
     
     // Create the archive file entries, skipping those that already exist
     idempotentBatchInsertArchiveFiles(conn, fileEvents);
-- 
GitLab