* Clean up tables
*
* @throws StoreException
*/
protected void cleanUpDBTables() throws StoreException {
CoordinatorStore store = new CoordinatorStore(false);
EntityManager entityManager = store.getEntityManager();
store.beginTrx();
Query q = entityManager.createNamedQuery("GET_WORKFLOWS");
List<WorkflowJobBean> wfjBeans = q.getResultList();
int wfjSize = wfjBeans.size();
for (WorkflowJobBean w : wfjBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_ACTIONS");
List<WorkflowActionBean> wfaBeans = q.getResultList();
int wfaSize = wfaBeans.size();
for (WorkflowActionBean w : wfaBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_COORD_JOBS");
List<CoordinatorJobBean> cojBeans = q.getResultList();
int cojSize = cojBeans.size();
for (CoordinatorJobBean w : cojBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_COORD_ACTIONS");
List<CoordinatorActionBean> coaBeans = q.getResultList();
int coaSize = coaBeans.size();
for (CoordinatorActionBean w : coaBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_BUNDLE_JOBS");
List<BundleJobBean> bjBeans = q.getResultList();
int bjSize = bjBeans.size();
for (BundleJobBean w : bjBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_BUNDLE_ACTIONS");
List<BundleActionBean> baBeans = q.getResultList();
int baSize = baBeans.size();
for (BundleActionBean w : baBeans) {
entityManager.remove(w);
}
q = entityManager.createNamedQuery("GET_SLA_EVENTS");
List<SLAEventBean> slaBeans = q.getResultList();
int slaSize = slaBeans.size();
for (SLAEventBean w : slaBeans) {
entityManager.remove(w);
}
store.commitTrx();
store.closeTrx();
log.info(wfjSize + " entries in WF_JOBS removed from DB!");
log.info(wfaSize + " entries in WF_ACTIONS removed from DB!");
log.info(cojSize + " entries in COORD_JOBS removed from DB!");
log.info(coaSize + " entries in COORD_ACTIONS removed from DB!");
log.info(bjSize + " entries in BUNDLE_JOBS removed from DB!");