Hi,
I am new to this Hibernate technology. I am going through Hibernate in Action to learn this technology.
I have few doubts of using Evict method.
As of my understanding when we use the evict method the object is detached from the session.
After that when we update the detached object in the same session is it will be persisted or not.
When you say evict, the object is detached that means it is not monitored for dirty checking. However when you call update it's again become managed so any changes will go to the database. For further clarification see "Hibernate Persistent Context and Session" at here
Indeed, while you may evict your POJO from the Hibernate session, a detached instance can once again become a 'persistent' instance, managed by Hibernate, as soon as it 'touches' the Hibernate Session, which can happen with a save, update, delete, query, etc. So, you detach your object, but it becomes persistent with the update.