diff --git a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/LaReferenciaStats.java b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/LaReferenciaStats.java index 9e7402ccc5..c6eb49ce06 100644 --- a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/LaReferenciaStats.java +++ b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/LaReferenciaStats.java @@ -118,11 +118,13 @@ public class LaReferenciaStats { System.out.println("====> LaReferencia created viewsStats"); log.info("LaReferencia views done"); System.out.println("====> LaReferencia creating downloadsStats"); - downloadsStats(); +// downloadsStats(); System.out.println("====> LaReferencia created downloadsStats"); -// log.info("LaReferencia downloads done"); -// updateProdTables(); -// log.info("LaReferencia update productions tables done"); + log.info("LaReferencia downloads done"); + System.out.println("====> LaReferencia updating Production Tables"); + updateProdTables(); + System.out.println("====> LaReferencia updated Production Tables"); + log.info("LaReferencia update productions tables done"); } catch (Exception e) { log.error("Failed to process logs: " + e); @@ -336,23 +338,29 @@ public class LaReferenciaStats { Statement stmt = ConnectDB.getConnection().createStatement(); ConnectDB.getConnection().setAutoCommit(false); - String sql = "insert into lareferencialog select * from lareferencialogtmp;"; + + System.out.println("====> Updating lareferencialog"); + String sql = "insert into " + ConnectDB.getUsageStatsDBSchema() + ".lareferencialog " + + "select * from " + ConnectDB.getUsageStatsDBSchema() + ".lareferencialogtmp"; stmt.executeUpdate(sql); - sql = "insert into views_stats select * from la_views_stats_tmp;"; + System.out.println("====> Updating views_stats"); + sql = "insert into " + ConnectDB.getUsageStatsDBSchema() + ".views_stats " + + "select * from " + ConnectDB.getUsageStatsDBSchema() + ".la_views_stats_tmp"; stmt.executeUpdate(sql); - sql = "insert into public.views_stats select * from la_views_stats_tmp;"; +// sql = "insert into public.views_stats select * from la_views_stats_tmp;"; +// stmt.executeUpdate(sql); + + System.out.println("====> Updating downloads_stats"); + sql = "insert into " + ConnectDB.getUsageStatsDBSchema() + ".downloads_stats " + + "select * from " + ConnectDB.getUsageStatsDBSchema() + ".la_downloads_stats_tmp"; stmt.executeUpdate(sql); - sql = "insert into downloads_stats select * from la_downloads_stats_tmp;"; - stmt.executeUpdate(sql); - - sql = "insert into public.downloads_stats select * from la_downloads_stats_tmp;"; - stmt.executeUpdate(sql); +// sql = "insert into public.downloads_stats select * from la_downloads_stats_tmp;"; +// stmt.executeUpdate(sql); stmt.close(); - ConnectDB.getConnection().commit(); ConnectDB.getConnection().close(); }