Close transaction while fetching recent events

This commit is contained in:
Kishan Kavala 2014-11-21 15:14:26 +05:30
parent 9eb8d538dd
commit 438f90a262
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,8 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
txn.rollback();
s_logger.error("error copying events from cloud db to usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
} finally {
txn.close();
}
// Copy event details from cloud db to usage db
@ -150,6 +152,8 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
txn.rollback();
s_logger.error("error copying event details from cloud db to usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
} finally {
txn.close();
}
return findRecentEvents(endDate);