pstmt = txn.prepareAutoCloseStatement(sql);
pstmt.setLong(1, instance.getAccountId());
pstmt.setLong(2, instance.getVmInstanceId());
pstmt.setInt(3, instance.getUsageType());
pstmt.executeUpdate();
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("error deleting usage vm instance with vmId: " + instance.getVmInstanceId() + ", for account with id: " + instance.getAccountId());
} finally {
txn.close();