public void fireEmployee(Employee firedEmployee, Company fromCompany) throws SQLException { Connection connection = oracleCM.getConnection(); try { connection.setAutoCommit(false); Company company = companyDAO.find(fromCompany.getId(), connection); company.getEmployees().remove(firedEmployee); companyDAO.update(company, connection); employeeDAO.delete(firedEmployee, connection); connection.commit(); } finally { connection.setAutoCommit(true); connection.close(); } }