diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/utils/DatabaseUtils.java b/src/main/java/org/gcube/dataanalysis/ecoengine/utils/DatabaseUtils.java index 793547f..5b20978 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/utils/DatabaseUtils.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/utils/DatabaseUtils.java @@ -174,12 +174,12 @@ public class DatabaseUtils { String[] row = values.get(i); sb.append("("); for (int j=0;j0 && stopIndex%chunkSize==0){ DatabaseFactory.executeSQLUpdate(insertFromBuffer(table, columnsNames, sb), dbconnection); stopIndex=chunkSize; sb = new StringBuffer(); @@ -189,8 +189,16 @@ public class DatabaseUtils { } if (stopIndex sublist = values.subList(stopIndex+1, valuesize); - insertChunksIntoTable(table, columnsNames, sublist, chunkSize,dbconnection); + if (sb.length()>0){ +// System.out.println(sb); + try{ + DatabaseFactory.executeSQLUpdate(insertFromBuffer(table, columnsNames, sb), dbconnection); + }catch(Exception e){ + System.out.println("Query:"+sb); + throw e; + } + + } } }