I believe this is due to the JDO initialization that occurs on first-use. I've seen the same things in my project and traced it back to JDO startup.
--Kevin -----Original Message----- From: Pascal Gheeraert [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 5:53 AM To: [EMAIL PROTECTED] Subject: [castor-dev] Preformance question : why first action on a DB takes so much time? Hi list, I just want to know why the very first action on a db (I'm using DB2) takes much more times than all the others. For example, I have in my database a collection of Channel element. No depedency and no lazy loading are made on associated objects. The channel are strictly the sames (assocaition and related tables are the sames, onlye the values change). When I launch my test case, i obtain the following times : ... [0]-INFO in com.ibm.essonnes.castor.jdoTestSuite.ChannelTest, ligne:467 -> Using JDO to perform the tests .[1492]-INFO in com.ibm.essonnes.rssFactory.CastorConf, ligne:57 -> Getting the database connection with pooled connection [5178]-INFO in com.ibm.essonnes.castor.jdoTestSuite.ChannelTest, ligne:70 -> Testing deleteChannel(int id) [7932]-INFO in com.ibm.essonnes.castor.jdoTestSuite.ChannelTest, ligne:445 -> ------------------------- | Time analyses results | ------------------------- Nbre of events => 5 Time at index 0 => id: Removing channel record, id=1 in table Channel with JDO, Time: 2548.0 ms Time at index 1 => id: Removing channel record, id=2 in table Channel with JDO, Time: 37.0 ms Time at index 2 => id: Removing channel record, id=3 in table Channel with JDO, Time: 20.0 ms Time at index 3 => id: Removing channel record, id=4 in table Channel with JDO, Time: 21.0 ms Time at index 4 => id: Removing channel record, id=5 in table Channel with JDO, Time: 36.0 ms ... Like you can see, the time needed to delete the first channel record is in average 130 times bigger than the others. Hope someone have an idea of what's going on. PS : Each channel record is deleted with the help of an OQLQuery. I also tried with the load method but nothing changes. Finnaly, I tested the way with no iteration : DELETE * FROM CHANNEL; but it gives me the same time (3 s). Have a good day, Regards Pascal ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
