-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Dirty detection and second level cache
PostPosted: Mon Jan 12, 2004 6:05 pm 
Newbie

Joined: Mon Jan 12, 2004 5:46 pm
Posts: 8
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 1:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate does not use the second-level cache for dirty checking. It is up to the user to decide if a detached object should be passed to update() or lock().


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.