git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@58677 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9b2b34b3de
commit
da08da01f1
|
@ -133,7 +133,8 @@ public class DatabaseFactory {
|
|||
} catch (Exception e) {
|
||||
|
||||
// System.out.println(String.format("Error while executing query: %1$s %2$s", query, e.getMessage()));
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
System.out.println(String.format("Error while executing query: %1$s %2$s", query, e.getMessage()));
|
||||
rollback(ss);
|
||||
}
|
||||
|
||||
|
@ -162,7 +163,7 @@ public class DatabaseFactory {
|
|||
|
||||
} catch (Exception e) {
|
||||
rollback(ss);
|
||||
e.printStackTrace();
|
||||
AnalysisLogger.getLogger().debug("ERROR IN UPDATE: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class AquamapsSuitable implements SpatialProbabilityDistributionTable{
|
|||
//to overwrite in case of 2050
|
||||
protected String type = null;
|
||||
|
||||
protected String generateMaxMinHspec(String minmaxTableName, String hspenTable, String occurrencePointsTable, SessionFactory dbHibConnection){
|
||||
public static String generateMaxMinHspec(String minmaxTableName, String hspenTable, String occurrencePointsTable, SessionFactory dbHibConnection){
|
||||
MaxMinGenerator maxmin = new MaxMinGenerator(dbHibConnection);
|
||||
if (occurrencePointsTable==null)
|
||||
occurrencePointsTable = "occurrencecells";
|
||||
|
|
|
@ -58,7 +58,7 @@ public class GeneratorT implements Runnable{
|
|||
config.setModel(algorithmName);
|
||||
|
||||
config.setParam("EnvelopeTable", envelopeTable);
|
||||
config.setParam("PreprocessedTable", preprocessedTable);
|
||||
// config.setParam("PreprocessedTable", preprocessedTable);
|
||||
|
||||
config.setParam("SpeciesName", speciesName);
|
||||
config.setParam("CsquarecodesTable", csquareTable);
|
||||
|
|
|
@ -160,10 +160,14 @@ public class DatabaseFactory{
|
|||
qr = ss.createSQLQuery(query);
|
||||
else
|
||||
qr = ss.createQuery(query);
|
||||
|
||||
List<Object> result = qr.list();
|
||||
|
||||
ss.getTransaction().commit();
|
||||
List<Object> result = null;
|
||||
try{
|
||||
result = qr.list();
|
||||
ss.getTransaction().commit();
|
||||
}catch(Exception e){
|
||||
System.out.println("Could not execute query "+e.getMessage());
|
||||
rollback(ss);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
System.out.println("Hibernate doesn't return a valid object when org.gcube.contentmanagement.lexicalmatcher retrieve UserState Object");
|
||||
|
@ -174,7 +178,8 @@ public class DatabaseFactory{
|
|||
if (result != null && result.size() != 0) {
|
||||
obj = result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// rollback(ss);
|
||||
|
||||
return obj;
|
||||
|
|
Loading…
Reference in New Issue