diff --git a/castor/db/oracleStager.sql b/castor/db/oracleStager.sql
index 2f0c257cee6b82d65eb44771f4bcb3a8f53a1234..204ae5d4717460f07dba3df153409d771b193dd0 100644
--- a/castor/db/oracleStager.sql
+++ b/castor/db/oracleStager.sql
@@ -266,9 +266,14 @@ BEGIN
       -- we can exit, we went though all files to be processed
       EXIT;
     END IF;
-    -- Lock the castorfile
-    SELECT id INTO varCfId FROM CastorFile
-     WHERE id = varCfId FOR UPDATE;
+    BEGIN
+      -- Lock the castorfile
+      SELECT id INTO varCfId FROM CastorFile
+       WHERE id = varCfId FOR UPDATE;
+    EXCEPTION WHEN NO_DATA_FOUND THEN
+      -- the file was dropped meanwhile, ignore and continue
+      CONTINUE;
+    END;
     -- Get the max replica number of the service class
     SELECT maxReplicaNb INTO varMaxReplicaNb
       FROM SvcClass WHERE id = varSvcClassId;