diff --git a/src/se/koc/hal/deamon/DataAggregatorDaemon.java b/src/se/koc/hal/deamon/DataAggregatorDaemon.java index e80f8588..cc503f7d 100755 --- a/src/se/koc/hal/deamon/DataAggregatorDaemon.java +++ b/src/se/koc/hal/deamon/DataAggregatorDaemon.java @@ -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();