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) { } catch (Exception e) {
// System.out.println(String.format("Error while executing query: %1$s %2$s", query, e.getMessage())); // 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); rollback(ss);
} }
@ -162,7 +163,7 @@ public class DatabaseFactory {
} catch (Exception e) { } catch (Exception e) {
rollback(ss); 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 //to overwrite in case of 2050
protected String type = null; 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); MaxMinGenerator maxmin = new MaxMinGenerator(dbHibConnection);
if (occurrencePointsTable==null) if (occurrencePointsTable==null)
occurrencePointsTable = "occurrencecells"; occurrencePointsTable = "occurrencecells";

View File

@ -58,7 +58,7 @@ public class GeneratorT implements Runnable{
config.setModel(algorithmName); config.setModel(algorithmName);
config.setParam("EnvelopeTable", envelopeTable); config.setParam("EnvelopeTable", envelopeTable);
config.setParam("PreprocessedTable", preprocessedTable); // config.setParam("PreprocessedTable", preprocessedTable);
config.setParam("SpeciesName", speciesName); config.setParam("SpeciesName", speciesName);
config.setParam("CsquarecodesTable", csquareTable); config.setParam("CsquarecodesTable", csquareTable);

View File

@ -160,10 +160,14 @@ public class DatabaseFactory{
qr = ss.createSQLQuery(query); qr = ss.createSQLQuery(query);
else else
qr = ss.createQuery(query); qr = ss.createQuery(query);
List<Object> result = null;
List<Object> result = qr.list(); try{
result = qr.list();
ss.getTransaction().commit(); ss.getTransaction().commit();
}catch(Exception e){
System.out.println("Could not execute query "+e.getMessage());
rollback(ss);
}
if (result == null) if (result == null)
System.out.println("Hibernate doesn't return a valid object when org.gcube.contentmanagement.lexicalmatcher retrieve UserState Object"); 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) { if (result != null && result.size() != 0) {
obj = result; obj = result;
} }
// rollback(ss); // rollback(ss);
return obj; return obj;