From: Christoph S. <ch...@mc...> - 2002-11-25 13:27:26
|
I have a really long running import, and I want to write the records to = the db as they come in. Is it save to clear the entries Map after a = flush? Or would you recommend a different approach? ----- Original Message -----=20 From: Gavin King=20 To: Christoph Sturm=20 Cc: hibernate list=20 Sent: Monday, November 25, 2002 2:23 PM Subject: Re: slow performance on flush Yup, all entries are kept in the session cache until you close the = session. Why would you use this kind of code?? Just flush() once at the = end (outside the loop). ----- Original Message -----=20 From: Christoph Sturm=20 To: hib...@li... ; Gavin King=20 Sent: Tuesday, November 26, 2002 12:18 AM Subject: slow performance on flush Hi all! I'm trying to increase the performance of this pseudocode: for (j=3D1;j<100;j++) { for (i=3D1;i<100;i++) { session.save(class) } session.flush(); session.connection().commit(); } Now my problem is that flush doesnt take a constant time, but every = invocation of flush takes more time than the last one, the more I flush = the slower it gets. To me it looks like hibernate keeps the references = to the flushed objects in the entries map, and doesnt remove them. Is = there anything I can do about it? regards chris |