Skip to content

Commit ca0a770

Browse files
kishankavalayadvr
authored andcommitted
Close transaction while fetching recent events
(cherry picked from commit 438f90a) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent fb1069a commit ca0a770

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public synchronized List<UsageEventVO> getRecentEvents(Date endDate) {
124124
txn.rollback();
125125
s_logger.error("error copying events from cloud db to usage db", ex);
126126
throw new CloudRuntimeException(ex.getMessage());
127+
} finally {
128+
txn.close();
127129
}
128130

129131
// Copy event details from cloud db to usage db
@@ -150,6 +152,8 @@ public synchronized List<UsageEventVO> getRecentEvents(Date endDate) {
150152
txn.rollback();
151153
s_logger.error("error copying event details from cloud db to usage db", ex);
152154
throw new CloudRuntimeException(ex.getMessage());
155+
} finally {
156+
txn.close();
153157
}
154158

155159
return findRecentEvents(endDate);

0 commit comments

Comments
 (0)