bug fix for aggregation transations

Former-commit-id: c17ab908a34f8cb2582f094895cec1a2c1ff4781
This commit is contained in:
Daniel Collin 2015-12-09 17:40:57 +01:00
parent fbb910ef94
commit b164474b76

View file

@ -174,8 +174,8 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon {
++count; ++count;
++samples; ++samples;
} }
DBConnection.execBatch(preparedInsertStmt);
if(!error){ if(!error){
DBConnection.execBatch(preparedInsertStmt);
HalContext.getDB().getConnection().commit(); HalContext.getDB().getConnection().commit();
}else{ }else{
HalContext.getDB().getConnection().rollback(); HalContext.getDB().getConnection().rollback();
@ -233,9 +233,9 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon {
preparedDeleteStmt.setInt(2, result.getInt("sequence_id")); preparedDeleteStmt.setInt(2, result.getInt("sequence_id"));
preparedDeleteStmt.addBatch(); preparedDeleteStmt.addBatch();
} }
if(!error){
DBConnection.execBatch(preparedInsertStmt); DBConnection.execBatch(preparedInsertStmt);
DBConnection.execBatch(preparedDeleteStmt); DBConnection.execBatch(preparedDeleteStmt);
if(!error){
HalContext.getDB().getConnection().commit(); HalContext.getDB().getConnection().commit();
}else{ }else{
HalContext.getDB().getConnection().rollback(); HalContext.getDB().getConnection().rollback();
@ -294,9 +294,9 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon {
preparedDeleteStmt.setInt(2, result.getInt("sequence_id")); preparedDeleteStmt.setInt(2, result.getInt("sequence_id"));
preparedDeleteStmt.addBatch(); preparedDeleteStmt.addBatch();
} }
if(!error){
DBConnection.execBatch(preparedInsertStmt); DBConnection.execBatch(preparedInsertStmt);
DBConnection.execBatch(preparedDeleteStmt); DBConnection.execBatch(preparedDeleteStmt);
if(!error){
HalContext.getDB().getConnection().commit(); HalContext.getDB().getConnection().commit();
}else{ }else{
HalContext.getDB().getConnection().rollback(); HalContext.getDB().getConnection().rollback();