From b164474b767d16ca4d58859926fea40fd9169931 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Wed, 9 Dec 2015 17:40:57 +0100 Subject: [PATCH] bug fix for aggregation transations Former-commit-id: c17ab908a34f8cb2582f094895cec1a2c1ff4781 --- src/se/koc/hal/deamon/DataAggregatorDaemon.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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();