Hi,
does hibernate check for dirty objects against the copy in the session's cache only? or
does it use the second level cache (if enabled) ?
Ex:
// ========= First session ========
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
MaintenanceObject mo = new MaintenanceObject("name","handling instructions");
session.save(mo);
tx.commit();
session.close();
// ========= Second session =======
session = sessionFactory.openSession();
tx = session.beginTransaction();
session.update(mo);
tx.commit();
session.close();
Will hibernate detect the 'mo' object as dirty in the second session? or will it
compare the 'mo' object's state with the one in the second level cache and find it to be clean.
PS:
I am using ehcache (read-write) and hibernate 2.1
Thanks in advance and
Best regards,
cdan.
|