
Why is dynamic update not working in hibernate?

Dynamic-update is not working. It means when you are running your update, new data is added in your table in place of the existing data update .The main reason is you are not beginning transaction. So import
org.hibernate.Transaction class ,start your transaction and commit it. Here I am giving you a small block of code for updating of employee detail-
public void updateEmployee(EmployeeForm employeeForm) {
Employee employee = new Employee();
employee.setEmpId(employeeForm.getId());
employee.setName(employeeForm.getName());
employee.setAddress(employeeForm.getAddress());
employee.setSalary(employeeForm.getSalary());
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
session. saveOrUpdate (employee);
tx.commit();
session.close();
}

What is dynamic-update ?
The dynamic-update attribute tells Hibernate whether to include unmodified properties in the SQL UPDATE statement.
Performance issue In a large table with many columns (legacy design) or contains large data volumes, update some unmodified columns are absolutely unnecessary and great impact on the system performance.