This commit is contained in:
Gianpaolo Coro 2012-09-18 15:19:04 +00:00
parent 9b2b34b3de
commit da08da01f1
4 changed files with 15 additions and 9 deletions

View File

@ -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());
}
}

View File

@ -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";

View File

@ -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);

View File

@ -160,10 +160,14 @@ public class DatabaseFactory{
qr = ss.createSQLQuery(query);
else
qr = ss.createQuery(query);
List<Object> result = qr.list();
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");
@ -175,6 +179,7 @@ public class DatabaseFactory{
obj = result;
}
// rollback(ss);
return obj;