The automatic dirty checking feature of Hibernate, calls update statement automatically on the objects that are modified in a transaction.
Let's understand it by the example given below:
...
SessionFactory factory = cfg.buildSessionFactory();
Session session1 = factory.openSession();
Transaction tx=session2.beginTransaction();
Employee e1 = (Employee) session1.get(Employee.class, Integer.valueOf(101));
e1.setSalary(70000);
tx.commit();
session1.close();
Here, after getting employee instance e1 and we are changing the state of e1.
After changing the state, we are committing the transaction. In such a case, the state will be updated automatically. This is known as dirty checking in hibernate.