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