Hi Experts, i have a performance issue in my application.
i am using hibernate 3.
here is description of the issue
i have a hibernate parent object and it has a set child object (collection)
single parent could have 20,000 children
i read the parent and get all the child objects into a collection
now i iterate over each child object in a for loop and update and save the object and commit...
first iteration : update the first child and commit --2 updates are fired to database- one for parent object and one for child object that was modified
second iteration: update the second child and commit --3 updates are fired to databse - one for parent object, one for the first child and one for the second child
note that though i have not modified the first child object in the second iteration, hibernate still fires an update to the first child object also......this becomes very expensive when i have 20,000 child objects. at the end of 20,000 iteration it would fire 20,000 updated to the database while i have only modified the last child record
how to solve this issue. pls help
Thanks
Raghav
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html