wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes automatic dirty checking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "automatic dirty checking" Watch "automatic dirty checking" New topic
Author

automatic dirty checking

Madhu Sudhana
Ranch Hand

Joined: Apr 16, 2006
Posts: 127
is it a good practice to make use of

automatic dirty checking concept in Hibernate application programming?
[ June 18, 2007: Message edited by: Madhusudhana Edintipal ]

"And the trouble is, if you don't risk anything, you risk even more." -- Erica Jong.
Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
well ... i would like to share my experience with you..
i used the hibernate in a scenario where.. i have some classes for master,detail and sub detail tables. mapped..

i had 2 cases
1- for new record. of master detail and sub detail..(this time all records are assumed to be new)
2- for editing.. here i can't ensure, what are the data user will delete,add and edit..
for example..
he first delete the existing detail,with sub detail.
then updated old data..
then inserted new data..in detail and in sub detail..
and then deleted newly entered data again..
and then inserted new data again in detail and sub detail with different values..

now i master object.. and all details and sub details are associated with..
i don't find any built in functionality at that time in hibernate which gives me the facility to just call a single method.. and it will consolidated records in memory and records in database.. accordingly.. got it.?
not even merge was doing that..
so in order to cope up this problem i maintained the status in pojo's i used to manipulate in order to keep the state of all objects..
and later i consolidate by my self..by getting all records rite now in DB.
with the detached objects..

if you experience such problem and got any built in solution kindly let me know too..


- thanks


Architect<br />SCJP<br />SCWCD<br />IBM-486
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: automatic dirty checking
 
Similar Threads
What is a dirty detection mechanism?
How to handle DynaValidatorActionForm in struts2
automatic dirty checking in hibernate
Updating single column using Hibernate
Dirty Checking??