diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index b3b52e060..b40a4f2c5 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -102,13 +102,14 @@ module.exports = Self => { const toTable = file.toTable; const baseName = file.fileName; - const tableName = `edi.${toTable}`; - await Self.rawSql(`DELETE FROM ??`, [tableName], options); - const tx = await Self.beginTransaction({}); + try { const options = {transaction: tx}; + const tableName = `edi.${toTable}`; + await Self.rawSql(`DELETE FROM ??`, [tableName], options); + for (const zipEntry of entries) { const entryName = zipEntry.entryName; console.log(`Reading file ${entryName}...`);