0 Replies Latest reply on Mar 10, 2013 10:58 PM by harikris

    update or insert taking too long...

    harikris

      Hi All,

       

      My setup is: JBOSS AS 7.1.1 and PostGreSql

       

      When there are no or very less (a couple of hundred) records in the table, my inserts/updates completes very fast.

      But when the number of records get to a couple of thousand, the inserts or updates take an extremely long time. For ex: inserting a record takes more than 1 or 2 seconds.

       

      Not sure where the problem is or where to start.

       

      My code to update the database looks like this -

       

                public long updateRecord(long id, List<MyData> myDataList) {

             Event eventFromDB = findById(id).get(0);

                               for(MyData myData : myDataList) {

                                              eventFromDB.getMyData().add(myData);

                               }

             em.merge(eventFromDB);

                               return 1L;

                }

       

      I am a newbie and have set up the jboss as to the best of my knowledge.

       

      I haven't done any configuration settings on either the JBOSS AS or the PostGreSQL.

       

      The JBOSS AS is running in the standalone mode using the standalone-full.xml config file.

       

      Thanks in advance.