From 26f5c62ffd7fe00bb7ad9dc9e1bed1946f5c1603 Mon Sep 17 00:00:00 2001 From: Manuel Soulier Date: Mon, 4 Dec 2023 11:41:09 +0100 Subject: [PATCH] fix: useless calculation as client token was already set --- .../ws/services/importServlet/dao/ClientDao.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java b/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java index 2391f2ef8..327b23bd4 100644 --- a/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java +++ b/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java @@ -163,11 +163,9 @@ private String addImage(String tableMetier, int executorConnectionId) throws Arc public void updatePilotage(String tableSource) throws ArcException { LoggerHelper.debugAsComment(LOGGER, timestamp, ": ClientDaoImpl.updatePilotage()"); - String clientOfTableSource = extractClientFromToken(); - StringBuilder query = new StringBuilder(); query.append("UPDATE " + ViewEnum.PILOTAGE_FICHIER.getFullName(environnement) + " T1 "); - query.append("SET client = array_append(client, '" + clientOfTableSource + "') "); + query.append("SET client = array_append(client, '" + this.client + "') "); query.append(", date_client = array_append( date_client, localtimestamp ) "); query.append("WHERE true "); query.append("AND EXISTS (SELECT 1 FROM " + tableSource + " T2 where T1." + ColumnEnum.ID_SOURCE.getColumnName() @@ -177,18 +175,6 @@ public void updatePilotage(String tableSource) throws ArcException { UtilitaireDao.get(0).executeBlock(connection, query.toString()); } - /** - * extract the client token name from the client - * - * @param client2 - * @return - */ - private String extractClientFromToken() { - return ManipString.substringBeforeFirst( - ManipString.substringAfterFirst(this.client, Delimiters.SQL_SCHEMA_DELIMITER), - Delimiters.SQL_TOKEN_DELIMITER); - } - public void createTableTrackRetrievedTables() throws ArcException { ArcPreparedStatementBuilder query = new ArcPreparedStatementBuilder(); query.build(SQL.DROP, SQL.TABLE, SQL.IF_EXISTS, this.tableWsTracking, SQL.END_QUERY);